Subject: bin/8050: unistd.h doesn't work with -D_XOPEN_SOURCE=500
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@netbsd.org>
List: netbsd-bugs
Date: 07/23/1999 17:01:56
>Number:         8050
>Category:       bin
>Synopsis:       unistd.h doesn't work with -D_XOPEN_SOURCE=500
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 23 16:50:01 1999
>Last-Modified:
>Originator:     Chris Demetriou
>Organization:
>Release:        1.4, recent -current
>Environment:
NetBSD/i386, running a stock 1.4 install.

>Description:
unistd.h doesn't tolerate being compiled with -D_XOPEN_SOURCE=500.

it would appear based on the (other) contents of unistd.h that
-D_XOPEN_SOURCE=500 is a reasonable thing to use, but unistd.h croaks
on it, with a message like:

/usr/include/unistd.h:270: syntax error before `fd_set'


>How-To-Repeat:

cat << __EOF__ > bar.c
#include <unistd.h>

main(){}
__EOF__
cc bar.c
cc -D_XOPEN_SOURCE bar.c
cc -D_XOPEN_SOURCE=500 bar.c


>Fix:

fix conditions under which fd_set will be defined, it'd seem.
>Audit-Trail:
>Unformatted: