summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2025-01-11 23:13:21 +0100
committerMike Yuan <me@yhndnzj.com>2025-01-11 23:47:51 +0100
commit1ca04eaf962521929cbd376566c03a9df0d2e4ca (patch)
tree47523ff74bcd412b4429eeac7fd21940ad4eac4b
parentExtend elf package metadata to pe/coff files (#35681) (diff)
downloadsystemd-1ca04eaf962521929cbd376566c03a9df0d2e4ca.tar.xz
systemd-1ca04eaf962521929cbd376566c03a9df0d2e4ca.zip
missing_syscall: require a bunch of syscalls below baseline
pidfd-related ones are left out and will be dealt with later.
-rw-r--r--src/basic/missing_syscall.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
index 8aba8584ac..75f4b8d81e 100644
--- a/src/basic/missing_syscall.h
+++ b/src/basic/missing_syscall.h
@@ -137,12 +137,7 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil
#if !HAVE_SETNS
static inline int missing_setns(int fd, int nstype) {
-# ifdef __NR_setns
return syscall(__NR_setns, fd, nstype);
-# else
- errno = ENOSYS;
- return -1;
-# endif
}
# define setns missing_setns
@@ -162,12 +157,7 @@ static inline pid_t raw_getpid(void) {
#if !HAVE_RENAMEAT2
static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
-# ifdef __NR_renameat2
return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
-# else
- errno = ENOSYS;
- return -1;
-# endif
}
# define renameat2 missing_renameat2
@@ -177,12 +167,7 @@ static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, c
#if !HAVE_KCMP
static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
-# if defined __NR_kcmp && __NR_kcmp >= 0
return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
-# else
- errno = ENOSYS;
- return -1;
-# endif
}
# define kcmp missing_kcmp
@@ -192,34 +177,19 @@ static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long i
#if !HAVE_KEYCTL
static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) {
-# if defined __NR_keyctl && __NR_keyctl >= 0
return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
-# else
- errno = ENOSYS;
- return -1;
-# endif
# define keyctl missing_keyctl
}
static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
-# if defined __NR_add_key && __NR_add_key >= 0
return syscall(__NR_add_key, type, description, payload, plen, ringid);
-# else
- errno = ENOSYS;
- return -1;
-# endif
# define add_key missing_add_key
}
static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
-# if defined __NR_request_key && __NR_request_key >= 0
return syscall(__NR_request_key, type, description, callout_info, destringid);
-# else
- errno = ENOSYS;
- return -1;
-# endif
# define request_key missing_request_key
}
@@ -661,12 +631,7 @@ static inline ssize_t missing_getdents64(int fd, void *buffer, size_t length) {
#if !HAVE_SCHED_SETATTR
static inline ssize_t missing_sched_setattr(pid_t pid, struct sched_attr *attr, unsigned int flags) {
-# if defined __NR_sched_setattr
return syscall(__NR_sched_setattr, pid, attr, flags);
-# else
- errno = ENOSYS;
- return -1;
-# endif
}
# define sched_setattr missing_sched_setattr