unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* New platform independent problem
@ 2006-01-20  5:47 djh
  2006-01-20 11:08 ` Eli Zaretskii
  2006-01-27 20:45 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: djh @ 2006-01-20  5:47 UTC (permalink / raw)


In December of last year, 2005, the cygwin developers deprecated d_ino 
out of the dirent.h defined dirent structure.  

This break emac's dired.c (from compiling)

Ref: http://www.cygwin.com/ml/cygwin/2005-12/msg00205.html

This change causes a "make bootstrap" error in building my emacs vers. 
22.0.50 source.

"gcc -c  -Demacs -DHAVE_CONFIG_H -DUSE_GTK  -I. ..snipped...-O2 dired.c
dired.c: In function `directory_files_internal':
dired.c:230: error: structure has no member named `d_ino'
dired.c: In function `file_name_completion':
dired.c:538: error: structure has no member named `d_ino'
make[1]: *** [dired.o] Error 1 "

Under the prior version of cygwin this built successfully.

I unfortunatley am not expert enough to suggest any fixes for this, but, 
I wanted to bring it to your attension to those of you out there who are 
and want emacs to continue to be usable on the newer version of cygwin.

Regards,
   Darel Henman

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: New platform independent problem
@ 2006-01-20 17:01 Eric Blake
  2006-01-20 17:22 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Eric Blake @ 2006-01-20 17:01 UTC (permalink / raw)
  Cc: cygwin, henman, emacs-devel

> You could have a flag that, if set, will instruct readdir to do the
> expensive processing.  Applications that need the real inode will set
> that flag.

And then we would have to change applications to call this nonstandard
entry point at the beginning of their program to set the flag.  As long
as we are editing programs, we might as well teach them to respect
a sentinel of -1 without having to resort to adding a nonstandard
entry point.

> > POSIX permits implementations to not have d_ino.  In other words, when it
> > comes to dirent.h, cygwin is fully POSIX-compliant to not have a d_ino
> > member, and applications had better not assume that d_ino exists.
> 
> That may be so, but I don't think I've seen packages that check
> whether d_ino exist in their configury.  They assume it does, AFAICS.

Most GNU packages DO check - coreutils, findutils, bash, tar, etc.  And
since POSIX makes it optional, ALL portable programs SHOULD check
for the existance of d_ino.  I was actually surprised that emacs does not.

> 
> > > It's bad mantra for an application to use a symbol that starts with
> > > "__", since those symbols are reserved for the library implementation.
> > 
> > My understanding is that leading __ is reserved for the IMPLEMENTATION in
> > general, not just the library implementation; cygwin is part of the
> > implementation.
> 
> I was responding to a suggestion to use __deprecated_d_ino in the
> Emacs code.  Emacs is certainly _not_ a part of implementation.

Correct.  But that wouldn't help you anyways - if you are using the
version of cygwin's dirent.h that spells it __deprecated_d_ino,
then you are also using the version of cygwin's version.h that
informs the cygwin1.dll to fill that entry with 0 rather than the hash.
In other words, cygwin is smart enough to know whether your
application was compiled with d_ino existance, and does not even
bother creating a non-zero __deprecated_d_ino.

> 
> > What platforms use d_ino==0 to mean an empty entry, rather than an entry
> > where st_ino must be checked?
> 
> I see it in Emacs, Corinna shows another example from rcp and scp.

And after further research, I have found that coreutils is inconsistent;
backupfile.c does it one way (0 means skip the entry, but don't care
if d_ino matches st_ino) while pwd.c does it another way (0 means
fall back to stat, so that result always matches st_ino, and skip
entry if stat also failed).  So now is the time to pick the behavior
that is easiest to turn into a reasonable coding standard across
all GNU platforms (and probably to add a gnulib module that
does the d_ino magic for you).

--
Eric Blake


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-02-23  9:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20  5:47 New platform independent problem djh
2006-01-20 11:08 ` Eli Zaretskii
2006-01-20 12:25   ` Corinna Vinschen
2006-01-20 13:59     ` Eric Blake
2006-01-20 14:14       ` Corinna Vinschen
2006-01-20 13:29   ` Igor Peshansky
2006-01-20 13:56     ` Eli Zaretskii
2006-01-20 14:18       ` Eric Blake
2006-01-20 16:48         ` Eli Zaretskii
2006-01-20 21:24         ` Andreas Schwab
2006-01-20 14:21       ` Corinna Vinschen
2006-01-27 20:45 ` Eli Zaretskii
2006-02-23  9:20   ` djh
  -- strict thread matches above, loose matches on Subject: below --
2006-01-20 17:01 Eric Blake
2006-01-20 17:22 ` Eli Zaretskii
2006-01-28 14:18   ` Corinna Vinschen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).