From 221f2898b9140b4cc103d2c485061023706c1fcf Mon Sep 17 00:00:00 2001 From: Nicolas Cavallari Date: Wed, 7 Apr 2021 19:08:23 +0200 Subject: 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 --- libc/sysdeps/linux/sparc/bits/fcntl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/sysdeps/linux/sparc/bits/fcntl.h') diff --git a/libc/sysdeps/linux/sparc/bits/fcntl.h b/libc/sysdeps/linux/sparc/bits/fcntl.h index 336f5ca43..935495937 100644 --- a/libc/sysdeps/linux/sparc/bits/fcntl.h +++ b/libc/sysdeps/linux/sparc/bits/fcntl.h @@ -51,6 +51,7 @@ # define O_DIRECT 0x100000 /* direct disk access hint */ # define O_NOATIME 0x200000 /* Do not set atime. */ # define O_PATH 0x1000000 /* Resolve pathname but do not open file. */ +# define O_TMPFILE 0x2010000 /* Atomically create nameless file. */ #endif #ifdef __USE_LARGEFILE64 -- cgit v1.2.3