1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

missing: add fsmount() syscall fallback definition

This commit is contained in:
Lennart Poettering 2023-03-07 14:36:03 +01:00
parent 2208d96623
commit 34a9da0d8e
2 changed files with 21 additions and 0 deletions

View File

@ -629,6 +629,7 @@ foreach ident : [
['open_tree', '''#include <sys/mount.h>'''], ['open_tree', '''#include <sys/mount.h>'''],
['fsopen', '''#include <sys/mount.h>'''], ['fsopen', '''#include <sys/mount.h>'''],
['fsconfig', '''#include <sys/mount.h>'''], ['fsconfig', '''#include <sys/mount.h>'''],
['fsmount', '''#include <sys/mount.h>'''],
['getdents64', '''#include <dirent.h>'''], ['getdents64', '''#include <dirent.h>'''],
] ]

View File

@ -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 #if !HAVE_GETDENTS64
static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) { static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) {