open: Add support for O_TMPFILE
commit221f2898b9140b4cc103d2c485061023706c1fcf
authorNicolas Cavallari <nicolas.cavallari@green-communications.fr>
Wed, 7 Apr 2021 17:08:23 +0000 (7 19:08 +0200)
committerWaldemar Brodkorb <wbx@openadk.org>
Fri, 9 Apr 2021 03:56:24 +0000 (9 05:56 +0200)
tree89ecaeda872ea2074d05b5941e20575d0b9238e1
parent2bf4991c4dd7b50b74656011dea9c40464ff390c
open: Add support for O_TMPFILE

Since Linux 3.11, O_TMPFILE allows to create unnamed files that can be
linked later on.  It is internally defined as (O_TMPFILE | O_DIRECTORY)
to make it fail on old kernels.

Copying definitions from glibc for O_TMPFILE is not enough to support
O_TMPFILE; The open() wrapper also need to pass the mode when the flag
contains O_TMPFILE, otherwise, it will pass mode 000 which will succeed
but yield unexpected results.

openat() is curiously not affected since it passes the mode
unconditionally..

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
34 files changed:
include/fcntl.h
libc/sysdeps/linux/aarch64/bits/fcntl.h
libc/sysdeps/linux/alpha/bits/fcntl.h
libc/sysdeps/linux/arc/bits/fcntl.h
libc/sysdeps/linux/arm/bits/fcntl.h
libc/sysdeps/linux/avr32/bits/fcntl.h
libc/sysdeps/linux/bfin/bits/fcntl.h
libc/sysdeps/linux/c6x/bits/fcntl.h
libc/sysdeps/linux/common/open.c
libc/sysdeps/linux/common/open64.c
libc/sysdeps/linux/cris/bits/fcntl.h
libc/sysdeps/linux/csky/bits/fcntl.h
libc/sysdeps/linux/frv/bits/fcntl.h
libc/sysdeps/linux/h8300/bits/fcntl.h
libc/sysdeps/linux/hppa/bits/fcntl.h
libc/sysdeps/linux/i386/bits/fcntl.h
libc/sysdeps/linux/ia64/bits/fcntl.h
libc/sysdeps/linux/kvx/bits/fcntl.h
libc/sysdeps/linux/lm32/bits/fcntl.h
libc/sysdeps/linux/m68k/bits/fcntl.h
libc/sysdeps/linux/metag/bits/fcntl.h
libc/sysdeps/linux/microblaze/bits/fcntl.h
libc/sysdeps/linux/mips/bits/fcntl.h
libc/sysdeps/linux/nds32/bits/fcntl.h
libc/sysdeps/linux/nios2/bits/fcntl.h
libc/sysdeps/linux/or1k/bits/fcntl.h
libc/sysdeps/linux/powerpc/bits/fcntl.h
libc/sysdeps/linux/riscv64/bits/fcntl.h
libc/sysdeps/linux/sh/bits/fcntl.h
libc/sysdeps/linux/sparc/bits/fcntl.h
libc/sysdeps/linux/sparc64/bits/fcntl.h
libc/sysdeps/linux/tile/bits/fcntl.h
libc/sysdeps/linux/x86_64/bits/fcntl.h
libc/sysdeps/linux/xtensa/bits/fcntl.h