unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ericblake@comcast.net (Eric Blake)
Cc: cygwin@cygwin.com, henman@it.to-be.co.jp, emacs-devel@gnu.org
Subject: Re: New platform independent problem
Date: Fri, 20 Jan 2006 17:01:37 +0000	[thread overview]
Message-ID: <012020061701.4999.43D11771000C3BE00000138722058861720A050E040D0C079D0A@comcast.net> (raw)

> 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


             reply	other threads:[~2006-01-20 17:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20 17:01 Eric Blake [this message]
2006-01-20 17:22 ` New platform independent problem Eli Zaretskii
2006-01-28 14:18   ` Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2006-01-20  5:47 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=012020061701.4999.43D11771000C3BE00000138722058861720A050E040D0C079D0A@comcast.net \
    --to=ericblake@comcast.net \
    --cc=cygwin@cygwin.com \
    --cc=emacs-devel@gnu.org \
    --cc=henman@it.to-be.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).