]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Define ioprio_{get,set} the same as other compat syscalls
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 14 Sep 2021 14:27:32 +0000 (16:27 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Sep 2021 10:58:47 +0000 (12:58 +0200)
meson.build
src/basic/missing_syscall.h

index 1c64547628f0a1f16aab4f2d69dc202fde43d5a3..30609f851523dbe0de4c395c432d85f5b7de86d5 100644 (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>'''],
index 9e3a165857d8490290982da9bfd4a5a5de1ea3bc..57dae77b5357d7b62039f307b3dca919faa399a1 100644 (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