[PATCH] Re: S_IFSOCK should be defined if _XOPEN_SOURCE=500

Jakub Jelinek jakub@redhat.com
Mon May 3 12:22:00 GMT 2004


On Mon, May 03, 2004 at 12:48:20PM +0200, Michael T Kerrisk wrote:
> In <sys/stat.h> there is:
> 
> # if (defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN2K) \
>      && defined __S_IFSOCK
> #  define S_IFSOCK	__S_IFSOCK
> # endif
> 
> This means that S_IFSOCK is only defined if _XOPEN_SOURCE 
> is 600.
> 
> In SUSv2 sockets were defined in the Networking Services 
> volume (XNS5) along.  Compliance with XNS5 is mandatory for 
> UNIX98 branding.  In other words, UNIX98 systems must 
> define S_IFSOCK in <sys/stat.h> when _XOPEN_SOURCE is 500, 
> and glibc should do this too.  Thus, the first line above 
> should read:
> 
> # if (defined __USE_BSD || defined __USE_MISC || defined
> __USE_XOPEN_EXTENDED) \

S_ISSOCK () is not defined with -D_XOPEN_SOURCE=600 either, which is clearly
a bug.
I have attached two alternative patches, one just adds S_ISSOCK ()
definition if -D_XOPEN_SOURCE=600, the other also moves S_I[FS]SOCK
and F_[SG]ETOWN from __USE_XOPEN2K to __USE_UNIX98 (all these
are XNS5 additions).  gethostname () is also a XNS5 addition
and <unistd.h> has
#if defined __USE_BSD || defined __USE_UNIX98
/* Put the name of the current host in no more than LEN bytes of NAME.
   The result is null-terminated if LEN is large enough for the full
   name and the terminator.  */
extern int gethostname (char *__name, size_t __len) __THROW;
#endif
so there is at least some precedent.

BTW: S_IFSOCK is also defined for __USE_MISC, wonder if S_ISSOCK
shouldn't be guarded by the same macros.

	Jakub
-------------- next part --------------
2004-05-03  Jakub Jelinek  <jakub@redhat.com>

	* io/sys/stat.h (S_ISSOCK): Define if __USE_BSD or __USE_XOPEN2K.

--- libc/io/sys/stat.h.jj	2003-01-02 08:51:18.000000000 +0100
+++ libc/io/sys/stat.h	2004-05-03 14:02:48.972756783 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-2002,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -137,13 +137,13 @@ __BEGIN_DECLS
 # define S_ISLNK(mode)	 __S_ISTYPE((mode), __S_IFLNK)
 #endif
 
-#ifdef	__USE_BSD
-# ifndef __S_IFLNK
-#  define S_ISLNK(mode)  0
-# endif
-# ifdef __S_IFSOCK
-#  define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
-# endif
+#if defined __USE_BSD && !defined __S_IFLNK
+# define S_ISLNK(mode)  0
+#endif
+
+#if (defined __USE_BSD || defined __USE_XOPEN2K) \
+    && defined __S_IFSOCK
+# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
 #endif
 
 /* These are from POSIX.1b.  If the objects are not implemented using separate
-------------- next part --------------
2004-05-03  Jakub Jelinek  <jakub@redhat.com>

	sysdeps/unix/bsd/bits/fcntl.h (F_SETOWN, F_GETOWN): Define if
	__USE_BSD or __USE_UNIX98.
	sysdeps/unix/bsd/ultrix4/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/unix/bsd/bsd4.4/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/common/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/unix/sysv/aix/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/unix/sysv/irix4/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/s390/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/cris/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/mips/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/sh/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/i386/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/m68k/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/ia64/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/hppa/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h (F_SETOWN, F_GETOWN):
	Likewise.
	sysdeps/generic/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	sysdeps/mach/hurd/bits/fcntl.h (F_SETOWN, F_GETOWN): Likewise.
	io/sys/stat.h (S_ISSOCK, S_IFSOCK): Likewise.

--- libc/sysdeps/unix/bsd/bits/fcntl.h.jj	2001-07-06 06:56:07.000000000 +0200
+++ libc/sysdeps/unix/bsd/bits/fcntl.h	2004-05-03 13:56:01.414796476 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for 4.3 BSD.
-   Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -85,7 +85,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/bsd/ultrix4/bits/fcntl.h.jj	2001-07-06 06:56:10.000000000 +0200
+++ libc/sysdeps/unix/bsd/ultrix4/bits/fcntl.h	2004-05-03 13:56:20.935298148 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Ultrix 4.
-   Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -87,7 +87,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_UNIX98
 #define	F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 #define	F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h.jj	2001-07-06 06:56:08.000000000 +0200
+++ libc/sysdeps/unix/bsd/bsd4.4/bits/fcntl.h	2004-05-03 13:56:43.029338608 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for 4.4 BSD.
-   Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -82,7 +82,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_UNIX98
 #define	F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 #define	F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h.jj	2001-07-06 06:56:10.000000000 +0200
+++ libc/sysdeps/unix/bsd/sun/sunos4/bits/fcntl.h	2004-05-03 13:57:08.116842601 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for SunOS 4.
-   Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -86,7 +86,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#ifdef __USE_BSD
+#if defined __USE_BSD || defined __USE_UNIX98
 #define	F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 #define	F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/common/bits/fcntl.h.jj	2001-07-06 06:56:10.000000000 +0200
+++ libc/sysdeps/unix/common/bits/fcntl.h	2004-05-03 13:57:28.840128718 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for general Unix system.
-   Copyright (C) 1991, 1992, 1995, 1997, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1995, 1997, 2000, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -79,7 +80,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	23	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	24	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/aix/bits/fcntl.h.jj	2001-07-06 06:56:11.000000000 +0200
+++ libc/sysdeps/unix/sysv/aix/bits/fcntl.h	2004-05-03 13:57:41.772811013 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -74,7 +74,7 @@
 # define F_SETLKW64     13	/* Set record locking info (blocking).  */
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/irix4/bits/fcntl.h.jj	2001-07-06 06:56:12.000000000 +0200
+++ libc/sysdeps/unix/sysv/irix4/bits/fcntl.h	2004-05-03 13:58:26.854731746 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for SGI Irix 4.
-   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1997, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -67,6 +67,8 @@
 #define F_RGETLK        20      /* Get info on a remote lock.  */
 #define F_RSETLK        21      /* Set or unlock a remote lock.  */
 #define F_RSETLKW       22      /* Set or unlock a remote lock and wait.  */
+#endif
+#if defined __USE_BSD || defined __USE_UNIX98
 #define F_GETOWN        10      /* Get owner; only works on sockets.  */
 #define F_SETOWN        11      /* Set owner; only works on sockets.  */
 #endif
--- libc/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/alpha/bits/fcntl.h	2004-05-03 13:58:41.167166771 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -75,7 +75,7 @@
 #define F_SETLK64	F_SETLK	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	F_SETLKW /* Set record locking info (blocking).  */
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/s390/bits/fcntl.h	2004-05-03 13:58:54.224826669 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -93,7 +93,7 @@
 # define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/cris/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/cris/bits/fcntl.h	2004-05-03 13:59:08.839207581 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +79,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h	2004-05-03 13:59:27.413878759 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux/PowerPC.
-   Copyright (C) 1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +79,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h	2004-05-03 13:59:50.036824432 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux/SPARC.
-   Copyright (C) 1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -76,7 +77,7 @@
 #define F_SETFD		2	/* Set file descriptor flags.  */
 #define F_GETFL		3	/* Get file status flags.  */
 #define F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	5	/* Get owner of socket (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/mips/bits/fcntl.h.jj	2003-04-04 07:12:00.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/mips/bits/fcntl.h	2004-05-03 13:59:59.619107162 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -81,7 +81,7 @@
 #define F_SETLK64	34	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	35	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	24	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	23	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/sh/bits/fcntl.h	2004-05-03 14:00:18.113792674 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +79,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).  */
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/i386/bits/fcntl.h	2004-05-03 14:00:31.001483032 +0200
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +79,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h	2004-05-03 14:00:41.180658791 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -78,7 +78,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h	2004-05-03 14:00:55.558082170 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/IA64.
-   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -75,7 +75,7 @@
 #define F_SETLK64	6	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	7	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/arm/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/arm/bits/fcntl.h	2004-05-03 14:01:06.781070864 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -79,7 +79,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h	2004-05-03 14:01:15.499508406 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/HPPA.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2002
+   Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2004
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -78,7 +78,7 @@
 #define F_SETLK64	9	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	10	/* Set record locking info (blocking).  */
 
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	11	/* Get owner of socket (receiver of SIGIO).  */
 # define F_SETOWN	12	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h.jj	2004-01-27 15:44:26.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h	2004-05-03 14:01:26.396555514 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -82,7 +82,7 @@
 #define F_SETLK64	13	/* Set record locking info (non-blocking).  */
 #define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_SETOWN	8	/* Get owner of socket (receiver of SIGIO).  */
 # define F_GETOWN	9	/* Set owner of socket (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/generic/bits/fcntl.h.jj	2001-07-06 06:55:50.000000000 +0200
+++ libc/sysdeps/generic/bits/fcntl.h	2004-05-03 14:01:40.696992689 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for stub configuration.
-   Copyright (C) 1991, 1992, 1997, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1997, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -54,7 +54,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/sysdeps/mach/hurd/bits/fcntl.h.jj	2001-08-23 06:34:41.000000000 +0200
+++ libc/sysdeps/mach/hurd/bits/fcntl.h	2004-05-03 14:01:53.687664592 +0200
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for GNU.
-   Copyright (C) 1993,94,96,97,98,99,2000,01 Free Software Foundation, Inc.
+   Copyright (C) 1993,94,96,97,98,99,2000,01,04 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -153,7 +153,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_XOPEN2K
+#if defined __USE_BSD || defined __USE_UNIX98
 # define F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
--- libc/io/sys/stat.h.jj	2003-01-02 08:51:18.000000000 +0100
+++ libc/io/sys/stat.h	2004-05-03 14:02:48.972756783 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1995-2002,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-2002,2003,2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -116,7 +116,7 @@ __BEGIN_DECLS
 # ifdef __S_IFLNK
 #  define S_IFLNK	__S_IFLNK
 # endif
-# if (defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN2K) \
+# if (defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98) \
      && defined __S_IFSOCK
 #  define S_IFSOCK	__S_IFSOCK
 # endif
@@ -137,13 +137,13 @@ __BEGIN_DECLS
 # define S_ISLNK(mode)	 __S_ISTYPE((mode), __S_IFLNK)
 #endif
 
-#ifdef	__USE_BSD
-# ifndef __S_IFLNK
-#  define S_ISLNK(mode)  0
-# endif
-# ifdef __S_IFSOCK
-#  define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
-# endif
+#if defined __USE_BSD && !defined __S_IFLNK
+# define S_ISLNK(mode)  0
+#endif
+
+#if (defined __USE_BSD || defined __USE_UNIX98) \
+    && defined __S_IFSOCK
+# define S_ISSOCK(mode) __S_ISTYPE((mode), __S_IFSOCK)
 #endif
 
 /* These are from POSIX.1b.  If the objects are not implemented using separate


More information about the Libc-alpha mailing list