strace/xlat/open_mode_flags.in
Dmitry V. Levin 11d1c182ba Use kernel's fcntl.h header instead of libc's for open_mode_flags
As definitions of O_* macros provided by various libc implementations
are usually less reliable than those provided by kernel headers, switch
to use kernel's fcntl.h header.

* open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
O_LARGEFILE fallback definitions assuming that the kernel headers
provide them.
* xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC.  Add O_TMPFILE
and __O_TMPFILE before O_DIRECTORY.  Remove "O_TMPFILE & ~O_DIRECTORY".
* tests/open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
workarounds for libc O_TMPFILE implementations.
* tests/openat.c: Include <asm/fcntl.h> instead of <fcntl.h>.
(test_mode_flag): New function.
(main): Use it to check decoding of all access modes and file flags.
* tests/gen_tests.in (openat): Add -a option.

Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
2018-02-06 23:46:18 +00:00

42 lines
494 B
Plaintext

O_CREAT
O_EXCL
O_NOCTTY
O_TRUNC
O_APPEND
O_NONBLOCK
/* O_SYNC should be listed before O_DSYNC and __O_SYNC */
O_SYNC
__O_SYNC
O_ASYNC
O_DSYNC
O_RSYNC
#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK)
O_NDELAY
#endif
O_PRIV
O_DIRECT
O_LARGEFILE
O_NOFOLLOW
O_NOATIME
O_CLOEXEC
O_PATH
/* O_TMPFILE should be listed before O_DIRECTORY and __O_TMPFILE */
O_TMPFILE
__O_TMPFILE
O_DIRECTORY
FNDELAY
FAPPEND
FMARK
FDEFER
FASYNC
FSHLOCK
FEXLOCK
FCREAT
FTRUNC
FEXCL
FNBIO
FSYNC
FNOCTTY
O_SHLOCK
O_EXLOCK