what is _XOPEN_SOURCE=500 needed for?

Daniel Stone daniel at fooishbar.org
Mon May 23 22:45:54 PDT 2005


On Mon, May 23, 2005 at 11:21:25PM -0600, Matthieu Herrb wrote:
> I'm trying to build the modular tree on OpenBSD. One problem I noticed 
> is that -D_XOPEN_SOURCE=500 is now added unconditionnaly to all CFLAGS.
> This breaks things on OpenBSD, so It should probably be defined only on 
> systems that needs it.
> One problem when dealing with this kind of macros and autoconf is to 
> find out what features exactly need this define.
> So does any one know why it's needed on Linux, Solaris and cygwin (these 
> are the only platforms that define it in the monolithic tree).

Xpoll.h requires fds_bits to be present in fd_set, which is defined as
such on glibc:
/* fd_set for select and pselect.  */
typedef struct
  {
    /* XPG4.2 requires this member name.  Otherwise avoid the name
       from the global namespace.  */
#ifdef __USE_XOPEN
    __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
# define __FDS_BITS(set) ((set)->fds_bits)
#else
    __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
# define __FDS_BITS(set) ((set)->__fds_bits)
#endif
  } fd_set;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20050524/54ce5aa4/attachment.pgp>


More information about the xorg mailing list