Subject: standards/22902: S_ISSOCK in sys/stat.h protected by _POSIX_C_SOURCE?
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <ianw@ieee.org>
List: netbsd-bugs
Date: 09/23/2003 07:34:11
>Number:         22902
>Category:       standards
>Synopsis:       S_ISSOCK in sys/stat.h protected by _POSIX_C_SOURCE?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 07:35:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Ian Wienand
>Release:        1.6.1 (alpha)
>Organization:
>Environment:
NetBSD morrison.wienand.home 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Mon Apr  7 07:59:37 UTC 2003     autobuild@cs20.apochromatic.org:/autobuilder/build/netbsd-1-6/alpha/OBJ/autobuilder/build/netbsd-1-6/src/sys/arch/alpha/compile/GENERIC alpha

>Description:
In <sys/stat.h>

#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
#define S_ISSOCK(m)     ((m & _S_IFMT) == _S_IFSOCK)    /* socket */
#define S_ISWHT(m)      ((m & _S_IFMT) == _S_IFWHT)     /* whiteout */
#endif

but by my reading of the standard @ 

http://www.opengroup.org/onlinepubs/007904975/basedefs/sys/stat.h.html

It says that S_ISSOCK should be defined. 

>How-To-Repeat:
Well I noticed when I was building rdiff-backup; it will fail because </usr/pkg/include/python2.3/pyconfig.h> has defined _POSIX_C_SOURCE for  __NetBSD_Version__ < 106200000.  
>Fix:
Unproect these macros from !defined(_POSIX_C_SOURCE)
>Release-Note:
>Audit-Trail:
>Unformatted: