diff --git a/meson.build b/meson.build index 6885884a003..4a597845365 100644 --- a/meson.build +++ b/meson.build @@ -629,6 +629,7 @@ foreach ident : [ ['open_tree', '''#include '''], ['fsopen', '''#include '''], ['fsconfig', '''#include '''], + ['fsmount', '''#include '''], ['getdents64', '''#include '''], ] diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 98cd037962b..3d66ab7d7a1 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) {