]> granicus.if.org Git - strace/commitdiff
xlat: add fallback definitions to open_mode_flags
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 5 Aug 2018 18:57:25 +0000 (18:57 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 5 Aug 2018 18:57:25 +0000 (18:57 +0000)
* xlat/open_mode_flags.in: Regenerate using maint/gen_xlat_defs.sh script
to provide fallback definitions.  Implement a workaround for O_NDELAY.

Co-Authored-by: Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
xlat/open_mode_flags.in

index c25808044bedfe0bf65900d604f9a55cf02872a4..e35ed48783201a5049b68f16d09dc0ffd9cce4c3 100644 (file)
-O_CREAT
-O_EXCL
-O_NOCTTY
-O_TRUNC
-O_APPEND
-O_NONBLOCK
+/* Generated by maint/gen_xlat_defs.sh -f '#o' -p '[_OF]' -c 'asm-generic/fcntl.h' -a 'asm/fcntl.h' */
+
+#if defined __hppa__ || defined __mips__
+O_CREAT        0400
+#elif defined __alpha__ || defined __sparc__
+O_CREAT        01000
+#else
+O_CREAT        0100
+#endif
+
+#if defined __hppa__ || defined __mips__
+O_EXCL 02000
+#elif defined __alpha__ || defined __sparc__
+O_EXCL 04000
+#else
+O_EXCL 0200
+#endif
+
+#if defined __mips__
+O_NOCTTY       04000
+#elif defined __alpha__
+O_NOCTTY       010000
+#elif defined __sparc__
+O_NOCTTY       0100000
+#elif defined __hppa__
+O_NOCTTY       0400000
+#else
+O_NOCTTY       0400
+#endif
+
+#if defined __alpha__ || defined __sparc__
+O_TRUNC        02000
+#else
+O_TRUNC        01000
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+O_APPEND       010
+#else
+O_APPEND       02000
+#endif
+
+#if defined __alpha__
+O_NONBLOCK     04
+#elif defined __mips__
+O_NONBLOCK     0200
+#elif defined __sparc__
+O_NONBLOCK     040000
+#elif defined __hppa__
+O_NONBLOCK     0200004
+#else
+O_NONBLOCK     04000
+#endif
+
 /* O_SYNC should be listed before O_DSYNC and __O_SYNC */
 O_SYNC
-__O_SYNC
+
+#if defined __mips__
+__O_SYNC       040000
+#elif defined __hppa__
+__O_SYNC       0100000
+#elif defined __alpha__
+__O_SYNC       020000000
+#elif defined __sparc__
+__O_SYNC       040000000
+#else
+__O_SYNC       04000000
+#endif
+
 O_ASYNC
-O_DSYNC
+
+#if defined __mips__
+O_DSYNC        020
+#elif defined __sparc__
+O_DSYNC        020000
+#elif defined __alpha__
+O_DSYNC        040000
+#elif defined __hppa__
+O_DSYNC        01000000
+#else
+O_DSYNC        010000
+#endif
+
+#if defined __hppa__
+O_RSYNC        02000000
+#else
 O_RSYNC
-#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK)
+#endif
+
+#if defined O_NDELAY && O_NDELAY & O_NONBLOCK  /* O_NDELAY is unusual */
+# ifndef STRACE_WORKAROUND_FOR_O_NDELAY
+# define STRACE_WORKAROUND_FOR_O_NDELAY
+/* On sparc32 O_NDELAY is erroneously defined to (0x0004 | O_NONBLOCK).  */
+/* On many architectures O_NDELAY is defined to O_NONBLOCK.  */
+/* Both cases are wrong and have to be fixed.  */
+# undef O_NDELAY
+# endif
+#endif /* O_NDELAY & O_NONBLOCK */
+
+#if defined __sparc__
+O_NDELAY       04
+#else
 O_NDELAY
 #endif
-O_DIRECT
-O_LARGEFILE
-O_NOFOLLOW
-O_NOATIME
-O_CLOEXEC
-O_PATH
+
+#if defined __sparc__
+O_DIRECT       04000000
+#elif defined __mips__
+O_DIRECT       0100000
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__
+O_DIRECT       0200000
+#elif defined __powerpc__
+O_DIRECT       0400000
+#elif defined __alpha__
+O_DIRECT       02000000
+#else
+O_DIRECT       040000
+#endif
+
+#if defined __hppa__
+O_LARGEFILE    04000
+#elif defined __mips__
+O_LARGEFILE    020000
+#elif defined __powerpc__
+O_LARGEFILE    0200000
+#elif defined __alpha__ || defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__
+O_LARGEFILE    0400000
+#elif defined __sparc__
+O_LARGEFILE    01000000
+#else
+O_LARGEFILE    0100000
+#endif
+
+#if defined __hppa__
+O_NOFOLLOW     0200
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__
+O_NOFOLLOW     0100000
+#elif defined __alpha__
+O_NOFOLLOW     0200000
+#else
+O_NOFOLLOW     0400000
+#endif
+
+#if defined __alpha__ || defined __hppa__
+O_NOATIME      04000000
+#elif defined __sparc__
+O_NOATIME      010000000
+#else
+O_NOATIME      01000000
+#endif
+
+#if defined __alpha__ || defined __hppa__
+O_CLOEXEC      010000000
+#elif defined __sparc__
+O_CLOEXEC      020000000
+#else
+O_CLOEXEC      02000000
+#endif
+
+#if defined __hppa__
+O_PATH 020000000
+#elif defined __alpha__
+O_PATH 040000000
+#elif defined __sparc__
+O_PATH 0100000000
+#else
+O_PATH 010000000
+#endif
+
 /* O_TMPFILE should be listed before O_DIRECTORY and __O_TMPFILE */
 O_TMPFILE
-__O_TMPFILE
-O_DIRECTORY
-FASYNC
+
+#if defined __hppa__
+__O_TMPFILE    040000000
+#elif defined __alpha__
+__O_TMPFILE    0100000000
+#elif defined __sparc__
+__O_TMPFILE    0200000000
+#else
+__O_TMPFILE    020000000
+#endif
+
+#if defined __hppa__
+O_DIRECTORY    010000
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__
+O_DIRECTORY    040000
+#elif defined __alpha__
+O_DIRECTORY    0100000
+#else
+O_DIRECTORY    0200000
+#endif
+
+#if defined __sparc__
+FASYNC 0100
+#elif defined __mips__
+FASYNC 010000
+#else
+FASYNC 020000
+#endif