summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-07 14:36:03 +0100
committerLennart Poettering <lennart@poettering.net>2023-03-09 16:12:37 +0100
commit34a9da0d8e04626e4fec1f076e814d633d149a58 (patch)
treea751d53090e8702315e6c2864bb77e53eb0a8d84
parent2208d9662313e90f4aa8d24f1573b8fbcd97120a (diff)
downloadsystemd-34a9da0d8e04626e4fec1f076e814d633d149a58.tar.gz
missing: add fsmount() syscall fallback definition
-rw-r--r--meson.build1
-rw-r--r--src/basic/missing_syscall.h20
2 files changed, 21 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 6885884a00..4a59784536 100644
--- a/meson.build
+++ b/meson.build
@@ -629,6 +629,7 @@ foreach ident : [
['open_tree', '''#include <sys/mount.h>'''],
['fsopen', '''#include <sys/mount.h>'''],
['fsconfig', '''#include <sys/mount.h>'''],
+ ['fsmount', '''#include <sys/mount.h>'''],
['getdents64', '''#include <dirent.h>'''],
]
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
index 98cd037962..3d66ab7d7a 100644
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -609,6 +609,26 @@ static inline int missing_fsconfig(int fd, unsigned cmd, const char *key, const
/* ======================================================================= */
+#if !HAVE_FSMOUNT
+
+#ifndef FSMOUNT_CLOEXEC
+#define FSMOUNT_CLOEXEC 0x00000001
+#endif
+
+static inline int missing_fsmount(int fd, unsigned flags, unsigned ms_flags) {
+# if defined __NR_fsmount && __NR_fsmount >= 0
+ return syscall(__NR_fsmount, fd, flags, ms_flags);
+# else
+ errno = ENOSYS;
+ return -1;
+# endif
+}
+
+# define fsmount missing_fsmount
+#endif
+
+/* ======================================================================= */
+
#if !HAVE_GETDENTS64
static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) {