]> granicus.if.org Git - strace/commit
Use kernel's fcntl.h header instead of libc's for open_mode_flags
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 2 Feb 2018 19:39:23 +0000 (19:39 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 6 Feb 2018 23:46:18 +0000 (23:46 +0000)
commit11d1c182bae0fee61986ee79eef141a28bbbf77b
treeaf8a4eb24e1ab74c2092d9eff48e584dbf697276
parent0ec9716124dd7c41d83279d843ad0d2c8a72435c
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>
open.c
tests/gen_tests.in
tests/open.c
tests/openat.c
xlat/open_mode_flags.in