Avoid local PLT for dirfd

Thomas Schwinge thomas@codesourcery.com
Wed Feb 29 00:53:00 GMT 2012


Hi!

On Tue, 28 Feb 2012 13:59:34 +0000 (UTC), "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Tue, 28 Feb 2012, Jakub Jelinek wrote:
> 
> > I'd say you should not introduce __dirfd, but instead just
> > add libc_hidden_proto (dirfd) (in include/dirent.h) and
> > libc_hidden_def (dirfd) (in the dirfd.c).
> > Then you don't need to adjust any users of that function.
> 
> Or you could simply restore the old include order in include/dirent.h, so 
> that <dirstream.h> is again included before <dirent/dirent.h> and so the 
> macro version of dirfd gets used as it did until the recent header 
> changes.

I don't quite understand the purpose of this _DIR_dirfd code layout.  If
this is an optimization internal to glibc, why is it in dirent/dirent.h,
which is an installed header?  (Surely no user code is meant to #define
_DIR_dirfd.)  Why isn't this optimization done unconditionally?  (In
include/dirent.h?)  (Also, a _DIR_dirfd definition is missing for GNU
Hurd; but I didn't check yet whether it's applicable there.)


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120229/fe04a012/attachment.sig>


More information about the Libc-alpha mailing list