1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00

Define ioprio_{get,set} the same as other compat syscalls

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-09-14 16:27:32 +02:00
parent 3c9fbb993b
commit 51fe206fb3
2 changed files with 22 additions and 0 deletions

View File

@ -501,6 +501,8 @@ foreach ident : [
#include <unistd.h>'''],
['pivot_root', '''#include <stdlib.h>
#include <unistd.h>'''], # no known header declares pivot_root
['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get
['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set
['name_to_handle_at', '''#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>'''],

View File

@ -41,6 +41,26 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old)
/* ======================================================================= */
#if !HAVE_IOPRIO_GET
static inline int missing_ioprio_get(int which, int who) {
return syscall(__NR_ioprio_get, which, who);
}
# define ioprio_get missing_ioprio_get
#endif
/* ======================================================================= */
#if !HAVE_IOPRIO_SET
static inline int missing_ioprio_set(int which, int who, int ioprio) {
return syscall(__NR_ioprio_set, which, who, ioprio);
}
# define ioprio_set missing_ioprio_set
#endif
/* ======================================================================= */
#if !HAVE_MEMFD_CREATE
static inline int missing_memfd_create(const char *name, unsigned int flags) {
# ifdef __NR_memfd_create