bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible -D_XOPEN_SOURCE=500 Discrepency


From: Brent Fulgham
Subject: Possible -D_XOPEN_SOURCE=500 Discrepency
Date: Wed, 25 Jul 2001 15:36:26 -0700

The Hurd header files do not seem to accurately duplicate the behavior
of Linux when the "-D_XOPEN_SOURCE=500" compiler flag is used.

You can observe this when compiling the patch program (patch version
2.5.4).  If _XOPEN_SOURCE is not defined, the "d_fileno" member of the
dirent structure is aliased as "d_ino" and patch will compile.  But if
_XOPEN_SOURCE is set to 500, the Hurd library headers do not alias
d_fileno as d_ino, and the compile fails.

Not having the XOPEN specifications available, I was wondering if any
of the GLIBC hackers know what the proper behavior is.  Based on a
review of the Linux and Hurd sources, the difference seems to be that
under Linux the dirent structure has a member named "d_ino" and
unconditionally aliases d_fileno to be d_ino:

#define d_fileno        d_ino           /* Backwards compatibility */

While under the Hurd, the opposite is done (the structure member
is named "d_fileno", and a conditional alias of d_ino is created
when XOPEN_SOURCE is not defined.

Does anyone know what the proper behavior is?  Does the XOPEN
specification require a "real" "d_ino" to be present in dirent?
Or, should setting XOPEN_SOURCE=500 simply not prevent the #define
of d_ino to be an alias for d_ino?

Thanks,

-Brent


reply via email to

[Prev in Thread] Current Thread [Next in Thread]