[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dirfd prototype
From: |
Eric Blake |
Subject: |
Re: dirfd prototype |
Date: |
Sat, 19 Dec 2009 17:55:27 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Jim Meyering on 12/19/2009 5:46 PM:
>> -extern int dirfd (DIR const *dir) _GL_ARG_NONNULL ((1));
>> +extern int dirfd (DIR *dir) _GL_ARG_NONNULL ((1));
>
> Do you know of any dirfd implementation that actually modifies the
> pointed-to buffer? I do not, and cannot imagine one that would.
> I would prefer to leave it "const" and to consider lobbying POSIX
> to permit the "const" declaration.
I don't know of any existing implementation that modifies the DIR struct.
However, POSIX is explicit that DIR need not have a backing fd when
diropen() is first called; therefore, I can see the feasibility of an
implementation that only opens the fd if dirfd() is called, and hence
needs to modify the struct as part of dirfd. I'm afraid we would lose
that battle to change POSIX.
At any rate, the problem came because I got a compilation error due to the
conflict in declarations between the system <dirent.h> and the gnulib
replacement, when testing out my warn-on-use macro. Basically, any
configure.ac that uses both the dirfd module and
AC_CHECK_DECLS_ONCE([dirfd]) will encounter the declaration clash, if we
revert that patch.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkstdf8ACgkQ84KuGfSFAYDORwCgohKqJWS3sXWJj2wrVXtassuX
3aQAn1KA6lvZ+EuHyWf7fiqSta71cBNw
=YJam
-----END PGP SIGNATURE-----