unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Blake <ebb9@byu.net>
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 07:18:18 -0700	[thread overview]
Message-ID: <43D0F12A.4000202@byu.net> (raw)
In-Reply-To: <uoe27q9y6.fsf@gnu.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eli Zaretskii on 1/20/2006 6:56 AM:
> 
>>Frankly, many programs expect that if d_ino is present, it has the correct
>>value (i.e., the same as st_ino).
> 
> 
> Which programs expect that, besides the two Chris mentioned?

Several of the coreutils expect that if d_ino is non-zero, it matches
st_ino.  This is in addition to findutils and bash.  But it is probably as
easy to teach programs that a sentinel value means fall back on st_ino as
it is to teach programs to not expect d_ino to exist.

>  My
> experience is the other way around: that d_ino is rarely used.

Which is why it is prohibitively expensive for cygwin to populate it with
the correct value on WinNT and Win2K; too few applications use d_ino to
make it worth doing the Windows equivalent of stat during the readdir() to
correctly populate the d_ino member.  But if we are going to populate
d_ino, it had better either be st_ino (so we aren't lying), or a sentinel
that makes it obvious that st_ino should be used instead (either 0 or -1).
 Fortunately, Win9x and WinXP had non-prohibitive costs to making d_ino
match st_ino.

> 
> 
>>Having the member and not setting it correctly is essentially lying
>>to the application.  Is it so bad for Cygwin to be honest?
> 
> 
> What is bad is to have dirent.h, but not some of the struct members it
> calls for.

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.

> 
> 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.  The goal here it to make sure that cygwin does not
pollute the namespace of a compliant app, since the rule is that a
compliant app can use any symbol not reserved by the standards that does
not start with __ without worry of conflict.  And no one has complained
yet that __deprecated_d_ino causes a conflict to a library.

> 
> 
>>Though why would a program refer to d_ino if it doesn't expect to do
>>anything with its content is beyond me.
> 
> 
> Emacs cares that d_ino is non-zero, meaning that this direntry is not
> empty, but otherwise the value of d_ino is not important.

What platforms use d_ino==0 to mean an empty entry, rather than an entry
where st_ino must be checked?  Is it worth introducing -1 as the cygwin
sentinel for non-empty entry, but where st_ino must be consulted, rather
than 0 as the sentinel?

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD0PEq84KuGfSFAYARApZPAJ9jDeUsHhMB59OIDUSzoqyhnSIrHACePz0F
/ENdWA/qbuGIYpCIEpKAv9A=
=gySC
-----END PGP SIGNATURE-----


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

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=43D0F12A.4000202@byu.net \
    --to=ebb9@byu.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).