summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-01-04 17:44:08 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-01-04 17:44:08 +0000
commit569867c132c2befc411ef12f1a667b998b43b8ba (patch)
tree3a3e015cf1972890f59e2a9c3f6fa218b0479c16
parent111f9f80f08512cf80ec339d2341bae1d5ce74e5 (diff)
parentd67a3ca1cfd79d4fede1910ef176ab3ca4290e31 (diff)
downloadx86_64-linux-glibc2.17-4.8-569867c132c2befc411ef12f1a667b998b43b8ba.tar.gz
Merge "glibc: pull in _all_ the O_TMPFILE definitions." into main am: ac2cf07b21 am: d67a3ca1cf
Original change: https://android-review.googlesource.com/c/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/+/2895527 Change-Id: I610cce3388344aed3e422f3fce673a88d2bf4b0a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--sysroot/usr/include/asm-generic/fcntl.h56
-rw-r--r--sysroot/usr/include/i386-linux-gnu/bits/fcntl-linux.h4
-rw-r--r--sysroot/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h5
3 files changed, 47 insertions, 18 deletions
diff --git a/sysroot/usr/include/asm-generic/fcntl.h b/sysroot/usr/include/asm-generic/fcntl.h
index a48937d..80f37a0 100644
--- a/sysroot/usr/include/asm-generic/fcntl.h
+++ b/sysroot/usr/include/asm-generic/fcntl.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H
@@ -5,7 +6,7 @@
/*
* FMODE_EXEC is 0x20
- * FMODE_NONOTIFY is 0x1000000
+ * FMODE_NONOTIFY is 0x4000000
* These cannot be used by userspace O_* until internal and external open
* flags are split.
* -Eric Paris
@@ -84,6 +85,13 @@
#define O_PATH 010000000
#endif
+#ifndef __O_TMPFILE
+#define __O_TMPFILE 020000000
+#endif
+
+/* a horrid kludge trying to make sure that this will fail on old kernels */
+#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
+
#ifndef O_NDELAY
#define O_NDELAY O_NONBLOCK
#endif
@@ -107,13 +115,13 @@
#define F_GETSIG 11 /* for sockets. */
#endif
-#ifndef CONFIG_64BIT
+#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
#ifndef F_GETLK64
#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14
#endif
-#endif
+#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
#ifndef F_SETOWN_EX
#define F_SETOWN_EX 15
@@ -124,6 +132,22 @@
#define F_GETOWNER_UIDS 17
#endif
+/*
+ * Open File Description Locks
+ *
+ * Usually record locks held by a process are released on *any* close and are
+ * not inherited across a fork().
+ *
+ * These cmd values will set locks that conflict with process-associated
+ * record locks, but are "owned" by the open file description, not the
+ * process. This means that they are inherited across fork() like BSD (flock)
+ * locks, and they are only released automatically when the last reference to
+ * the the open file against which they were acquired is put.
+ */
+#define F_OFD_GETLK 36
+#define F_OFD_SETLK 37
+#define F_OFD_SETLKW 38
+
#define F_OWNER_TID 0
#define F_OWNER_PID 1
#define F_OWNER_PGRP 2
@@ -156,6 +180,10 @@ struct f_owner_ex {
blocking */
#define LOCK_UN 8 /* remove lock */
+/*
+ * LOCK_MAND support has been removed from the kernel. We leave the symbols
+ * here to not break legacy builds, but these should not be used in new code.
+ */
#define LOCK_MAND 32 /* This is a mandatory flock ... */
#define LOCK_READ 64 /* which allows concurrent read operations */
#define LOCK_WRITE 128 /* which allows concurrent write operations */
@@ -164,26 +192,19 @@ struct f_owner_ex {
#define F_LINUX_SPECIFIC_BASE 1024
#ifndef HAVE_ARCH_STRUCT_FLOCK
-#ifndef __ARCH_FLOCK_PAD
-#define __ARCH_FLOCK_PAD
-#endif
-
struct flock {
short l_type;
short l_whence;
__kernel_off_t l_start;
__kernel_off_t l_len;
__kernel_pid_t l_pid;
- __ARCH_FLOCK_PAD
-};
+#ifdef __ARCH_FLOCK_EXTRA_SYSID
+ __ARCH_FLOCK_EXTRA_SYSID
#endif
-
-#ifndef CONFIG_64BIT
-
-#ifndef HAVE_ARCH_STRUCT_FLOCK64
-#ifndef __ARCH_FLOCK64_PAD
-#define __ARCH_FLOCK64_PAD
+#ifdef __ARCH_FLOCK_PAD
+ __ARCH_FLOCK_PAD
#endif
+};
struct flock64 {
short l_type;
@@ -191,9 +212,10 @@ struct flock64 {
__kernel_loff_t l_start;
__kernel_loff_t l_len;
__kernel_pid_t l_pid;
+#ifdef __ARCH_FLOCK64_PAD
__ARCH_FLOCK64_PAD
-};
#endif
-#endif /* !CONFIG_64BIT */
+};
+#endif /* HAVE_ARCH_STRUCT_FLOCK */
#endif /* _ASM_GENERIC_FCNTL_H */
diff --git a/sysroot/usr/include/i386-linux-gnu/bits/fcntl-linux.h b/sysroot/usr/include/i386-linux-gnu/bits/fcntl-linux.h
index fc51036..7434183 100644
--- a/sysroot/usr/include/i386-linux-gnu/bits/fcntl-linux.h
+++ b/sysroot/usr/include/i386-linux-gnu/bits/fcntl-linux.h
@@ -96,6 +96,9 @@
#ifndef __O_DSYNC
# define __O_DSYNC 010000
#endif
+#ifndef __O_TMPFILE
+# define __O_TMPFILE (020000000 | __O_DIRECTORY)
+#endif
#ifndef F_GETLK
# ifndef __USE_FILE_OFFSET64
@@ -128,6 +131,7 @@
# define O_DIRECT __O_DIRECT /* Direct disk access. */
# define O_NOATIME __O_NOATIME /* Do not set atime. */
# define O_PATH __O_PATH /* Resolve pathname but do not open file. */
+# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */
#endif
/* For now, Linux has no separate synchronicitiy options for read
diff --git a/sysroot/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h b/sysroot/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h
index 11800d6..7434183 100644
--- a/sysroot/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h
+++ b/sysroot/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h
@@ -43,7 +43,6 @@
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
-#define O_TMPFILE 020200000
#ifndef O_CREAT
# define O_CREAT 0100 /* Not fcntl. */
#endif
@@ -97,6 +96,9 @@
#ifndef __O_DSYNC
# define __O_DSYNC 010000
#endif
+#ifndef __O_TMPFILE
+# define __O_TMPFILE (020000000 | __O_DIRECTORY)
+#endif
#ifndef F_GETLK
# ifndef __USE_FILE_OFFSET64
@@ -129,6 +131,7 @@
# define O_DIRECT __O_DIRECT /* Direct disk access. */
# define O_NOATIME __O_NOATIME /* Do not set atime. */
# define O_PATH __O_PATH /* Resolve pathname but do not open file. */
+# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */
#endif
/* For now, Linux has no separate synchronicitiy options for read