Browse Source

fcntl.h: fixup namespace for O_DIRECTORY/O_NOFOLLOW/O_CLOEXEC

Sync with GNU C library. Found while trying to compile
linux-rdma to uClibc-ng.

Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Waldemar Brodkorb 6 years ago
parent
commit
197a82dd6d

+ 5 - 2
libc/sysdeps/linux/aarch64/bits/fcntl.h

@@ -42,12 +42,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 040000
 # define O_NOFOLLOW	0100000
+# define O_CLOEXEC     02000000
+#endif
+
+#ifdef __USE_GNU
 # define O_DIRECT	0200000
 # define O_NOATIME     01000000
-# define O_CLOEXEC     02000000
 # define O_PATH       010000000
 #endif
 

+ 5 - 2
libc/sysdeps/linux/alpha/bits/fcntl.h

@@ -44,12 +44,15 @@
 #define O_FSYNC		O_SYNC
 #define O_ASYNC		020000	/* fcntl, for BSD compatibility */
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0100000	/* Must be a directory.  */
 # define O_NOFOLLOW	0200000	/* Do not follow links.  */
+# define O_CLOEXEC    010000000 /* Set close_on_exec.  */
+#endif
+
+#ifdef __USE_GNU
 # define O_DIRECT      02000000 /* Direct disk access.  */
 # define O_NOATIME     04000000 /* Do not set atime.  */
-# define O_CLOEXEC    010000000 /* Set close_on_exec.  */
 # define O_PATH       040000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/arc/bits/fcntl.h

@@ -31,12 +31,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.  */
 # define O_PATH	     010000000  /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/arm/bits/fcntl.h

@@ -44,12 +44,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 040000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
+# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
+#endif
+
+#ifdef __USE_GNU
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME     01000000 /* Do not set atime.  */
-# define O_CLOEXEC     02000000 /* Set close_on_exec.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/avr32/bits/fcntl.h

@@ -25,12 +25,15 @@
 #define O_SYNC		00010000
 #define O_ASYNC		00020000
 
-#ifdef __USE_GNU
-# define O_DIRECT	00040000	/* must be a directory */
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	00200000	/* direct disk access */
 # define O_NOFOLLOW	00400000	/* don't follow links */
-# define O_NOATIME	01000000	/* don't set atime */
 # define O_CLOEXEC      02000000	/* set close_on_exec */
+#endif
+
+#ifdef __USE_GNU
+# define O_DIRECT	00040000	/* must be a directory */
+# define O_NOATIME	01000000	/* don't set atime */
 # define O_PATH        010000000	/* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/bfin/bits/fcntl.h

@@ -43,12 +43,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 040000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
+# define O_CLOEXEC     02000000	/* set close_on_exec */
+#endif
+ 
+#ifdef __USE_GNU
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME	01000000	/* don't set atime */
-# define O_CLOEXEC	02000000	/* set close_on_exec */
 # define O_PATH        010000000	/* Resolve pathname but do not open file.  */
 #endif
 

+ 7 - 4
libc/sysdeps/linux/c6x/bits/fcntl.h

@@ -42,14 +42,17 @@
 #define O_SYNC		 010000
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
-#define O_DIRECT	 040000
 
-#ifdef __USE_GNU
-# define O_LARGEFILE	0100000
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* don't follow links */
-# define O_NOATIME      01000000
 # define O_CLOEXEC	02000000/* set close on exec */
+#endif
+
+#ifdef __USE_GNU
+# define O_DIRECT	 040000
+# define O_LARGEFILE	0100000
+# define O_NOATIME      01000000
 # define O_PATH        010000000/* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/cris/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH        010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/frv/bits/fcntl.h

@@ -43,12 +43,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 /* don't 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 /* don't set atime */
 # define O_PATH        010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/h8300/bits/fcntl.h

@@ -43,12 +43,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 3
libc/sysdeps/linux/hppa/bits/fcntl.h

@@ -43,13 +43,15 @@
 #define O_NDELAY	O_NONBLOCK
 #define O_NOCTTY	00400000 /* not fcntl */
 
+#ifdef __USE_XOPEN2K8
+# define O_DIRECTORY	00010000 /* Must be a directory. */
+# define O_NOFOLLOW	00000200 /* Do not follow links. */
+# define O_CLOEXEC	010000000 /* set close_on_exec */
+#endif
 
 #ifdef __USE_GNU
 # define O_DIRECT	00040000 /* Direct disk access. */
-# define O_DIRECTORY	00010000 /* Must be a directory. */
-# define O_NOFOLLOW	00000200 /* Do not follow links. */
 # define O_NOATIME	04000000 /* Do not set atime. */
-# define O_CLOEXEC	010000000 /* set close_on_exec */
 # define O_PATH		020000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/i386/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/ia64/bits/fcntl.h

@@ -43,12 +43,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.  */
 # define O_PATH        010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/lm32/bits/fcntl.h

@@ -43,12 +43,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# 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.  */
-# define O_CLOEXEC     02000000 /* set close_on_exec */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/m68k/bits/fcntl.h

@@ -43,12 +43,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 040000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0100000	/* Do not follow links.	 */
+# define O_CLOEXEC	02000000 /* set close_on_exec */
+#endif
+
+#ifdef __USE_GNU
 # define O_DIRECT	0200000	/* Direct disk access.	*/
 # define O_NOATIME	01000000 /* Do not set atime.  */
-# define O_CLOEXEC	02000000 /* set close_on_exec */
 # define O_PATH        010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/metag/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/microblaze/bits/fcntl.h

@@ -43,12 +43,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	 0200000	/* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# 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.  */
-# define O_CLOEXEC     02000000 /* set close_on_exec */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/mips/bits/fcntl.h

@@ -45,12 +45,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 0x1000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_NOFOLLOW	0x20000	/* Do not follow links.	 */
-# define O_DIRECT	0x8000	/* Direct disk access hint.  */
 # define O_DIRECTORY	0x10000	/* Must be a directory.	 */
-# define O_NOATIME	0x40000	/* Do not set atime.  */
 # define O_CLOEXEC     02000000 /* set close_on_exec */
+#endif
+
+#ifdef __USE_GNU
+# define O_DIRECT	0x8000	/* Direct disk access hint.  */
+# define O_NOATIME	0x40000	/* Do not set atime.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/nds32/bits/fcntl.h

@@ -48,12 +48,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/nios2/bits/fcntl.h

@@ -43,12 +43,15 @@
 #define O_FSYNC		 O_SYNC
 #define O_ASYNC		 020000
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_DIRECTORY	0200000 /* Must be a directory.	 */
 # define O_NOFOLLOW	0400000	/* Do not follow links.	 */
+# 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.  */
-# define O_CLOEXEC     02000000 /* set close_on_exec */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/or1k/bits/fcntl.h

@@ -43,12 +43,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/powerpc/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/sh/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 5 - 2
libc/sysdeps/linux/sparc/bits/fcntl.h

@@ -41,12 +41,15 @@
 #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.  */
 # define O_PATH       0x1000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/x86_64/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif
 

+ 6 - 3
libc/sysdeps/linux/xtensa/bits/fcntl.h

@@ -44,12 +44,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.  */
 # define O_PATH       010000000 /* Resolve pathname but do not open file.  */
 #endif