about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-01-09 10:56:41 -0800
committerUlrich Drepper <drepper@redhat.com>2010-01-09 10:56:41 -0800
commitf095bb7204d80f609a73a22796edd6cffd4c6add (patch)
tree2b909bba9e4857eaee4761cacc16a69e7ecd480a /sysdeps/unix
parent44dcc00292b965b3b6bff8415175d6a3e290aab7 (diff)
downloadglibc-f095bb7204d80f609a73a22796edd6cffd4c6add.tar.gz
glibc-f095bb7204d80f609a73a22796edd6cffd4c6add.tar.xz
glibc-f095bb7204d80f609a73a22796edd6cffd4c6add.zip
Add support for XPG7 testing.
The header conformance testing code needed extending for XPG7.  This
exposed a few bugs in the headers.  There are more changes to come.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/bsd/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/bits/fcntl.h14
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/fcntl.h15
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h14
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h15
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/sh/bits/fcntl.h15
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h12
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/stat.h4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h15
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/stat.h4
15 files changed, 82 insertions, 50 deletions
diff --git a/sysdeps/unix/bsd/bits/stat.h b/sysdeps/unix/bsd/bits/stat.h
index 84a58ffbc9..16e5c520fe 100644
--- a/sysdeps/unix/bsd/bits/stat.h
+++ b/sysdeps/unix/bsd/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 96, 97, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1996-2000,2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/bits/stat.h b/sysdeps/unix/sysv/bits/stat.h
index f9a9e614d5..a860b9fe8a 100644
--- a/sysdeps/unix/sysv/bits/stat.h
+++ b/sysdeps/unix/sysv/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996, 1997, 2000, 2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index be5272333b..e3f1970086 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2009, 2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index 8eaf7c368b..6693889542 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -45,13 +45,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	 040000	/* Direct disk access.	*/
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
-# define O_NOATIME     01000000 /* Do not set atime.  */
 # define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
+#ifdef __USE_GNU
+# define O_DIRECT	 040000	/* Direct disk access.	*/
+# define O_NOATIME     01000000 /* Do not set atime.  */
+#endif
 
 /* For now Linux has synchronisity options for data and read operations.
    We define the symbols here but let them do the same as O_SYNC since
@@ -84,7 +86,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_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -100,6 +102,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index c65a11e1ca..33635fd9e0 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux/IA64.
-   Copyright (C) 1999,2000,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2004, 2006, 2007, 2009, 2010
+   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
@@ -44,13 +45,15 @@
 #define O_FSYNC		O_SYNC
 #define O_ASYNC		020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	040000
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* must be a directory */
 # define O_NOFOLLOW	0400000 /* don't follow links */
-# define O_NOATIME	01000000 /* Do not set atime.  */
 # define O_CLOEXEC	02000000 /* Set close_on_exec.  */
 #endif
+#ifdef __USE_GNU
+# define O_DIRECT	040000
+# define O_NOATIME	01000000 /* Do not set atime.  */
+#endif
 
 #ifdef __USE_LARGEFILE64
 /* Not necessary, files are always with 64bit off_t.  */
@@ -80,7 +83,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_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -96,6 +99,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
index 75a3318286..98dadf9984 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2002, 2009, 2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 40fe1e50d7..fea347bfc2 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/PowerPC.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
+   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -45,13 +45,15 @@
 #define O_FSYNC		O_SYNC
 #define O_ASYNC		020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	0400000	/* Direct disk access.	*/
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 040000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
-# define O_NOATIME	01000000 /* Do not set atime.  */
 # define O_CLOEXEC	02000000 /* Set close_on_exec.  */
 #endif
+#ifdef __USE_GNU
+# define O_DIRECT	0400000	/* Direct disk access.	*/
+# define O_NOATIME	01000000 /* Do not set atime.  */
+#endif
 
 #ifdef __USE_LARGEFILE64
 # define O_LARGEFILE	0200000
@@ -84,7 +86,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_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -100,6 +102,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
index 81879ca1fe..9027376979 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009
+/* Copyright (C) 1992, 1995-2002, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index c9e6a4504b..aeb1e0fe9b 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000,2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 2000-2002,2004,2006,2007,2009,2010
+   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
@@ -45,13 +46,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	 040000	/* Direct disk access.	*/
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
-# define O_NOATIME     01000000 /* Do not set atime.  */
 # define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
+#ifdef __USE_GNU
+# define O_DIRECT	 040000	/* Direct disk access.	*/
+# define O_NOATIME     01000000 /* Do not set atime.  */
+#endif
 
 #ifdef __USE_LARGEFILE64
 # if __WORDSIZE == 64
@@ -99,7 +102,7 @@
 # define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
 
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -115,6 +118,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h
index 64be9a10fd..2cd5396eaa 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2009, 2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index 8eaf7c368b..2a4123c610 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -45,14 +45,17 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	 040000	/* Direct disk access.	*/
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
-# define O_NOATIME     01000000 /* Do not set atime.  */
 # define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
 
+#ifdef __USE_GNU
+# define O_DIRECT	 040000	/* Direct disk access.	*/
+# define O_NOATIME     01000000 /* Do not set atime.  */
+#endif
+
 /* For now Linux has synchronisity options for data and read operations.
    We define the symbols here but let them do the same as O_SYNC since
    this is a superset.	*/
@@ -84,7 +87,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_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -100,6 +103,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 03c5ba59bd..c491a415b4 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/SPARC.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
+   Copyright (C) 1995-1998, 2000, 2003, 2004, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -44,12 +44,14 @@
 #define O_NDELAY	(0x0004 | O_NONBLOCK)
 #define O_NOCTTY	0x8000	/* not fcntl */
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0x10000 /* must be a directory */
 # define O_NOFOLLOW	0x20000 /* don't follow links */
+# define O_CLOEXEC	0x400000 /* Set close_on_exit.  */
+#endif
+#ifdef __USE_GNU
 # define O_DIRECT	0x100000 /* direct disk access hint */
 # define O_NOATIME	0x200000 /* Do not set atime.  */
-# define O_CLOEXEC	0x400000 /* Set close_on_exit.  */
 #endif
 
 #ifdef __USE_LARGEFILE64
@@ -82,7 +84,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_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_GETOWN	5	/* Get owner (process receiving SIGIO).  */
 # define F_SETOWN	6	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -107,6 +109,8 @@
 # define F_SETLEASE     1024	/* Set a lease.  */
 # define F_GETLEASE     1025	/* Enquire what lease is active.  */
 # define F_NOTIFY       1026	/* Request notfications on a directory.  */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
index 175fdb8570..407ca2d7b5 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-2002,2006,2009,2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index 43835081c0..aa04e0e490 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -1,5 +1,6 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2004,2006,2007,2009,2010
+   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
@@ -45,13 +46,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	 040000	/* Direct disk access.	*/
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
-# define O_NOATIME     01000000 /* Do not set atime.  */
 # define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 #endif
+#ifdef __USE_GNU
+# define O_DIRECT	 040000	/* Direct disk access.	*/
+# define O_NOATIME     01000000 /* Do not set atime.  */
+#endif
 
 /* For now Linux has synchronisity options for data and read operations.
    We define the symbols here but let them do the same as O_SYNC since
@@ -98,7 +101,7 @@
 # define F_SETLKW64	14	/* Set record locking info (blocking).	*/
 #endif
 
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_SETOWN	8	/* Get owner (process receiving SIGIO).  */
 # define F_GETOWN	9	/* Set owner (process receiving SIGIO).  */
 #endif
@@ -114,6 +117,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+#endif
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
 				   close-on-exit set.  */
 #endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
index 9d12315e1a..cfc3f665dc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2000,2001,2002,2003,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2003,2009,2010 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
@@ -16,7 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef _SYS_STAT_H
+#if !defined _SYS_STAT_H && !defined _FCNTL_H
 # error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
 #endif