]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/missing_syscall.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / basic / missing_syscall.h
index 2948f789b519085e2b28d861405e738d102236ae..d1aa32218b34ad34df72bc5d8bd843cc93a22838 100644 (file)
@@ -1,16 +1,25 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 #pragma once
 
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-  Copyright 2016 Zbigniew JÄ™drzejewski-Szmek
-***/
-
 /* Missing glibc definitions to access certain kernel APIs */
 
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/syscall.h>
 #include <sys/types.h>
+#include <unistd.h>
+
+#ifdef ARCH_MIPS
+#include <asm/sgidefs.h>
+#endif
+
+#include "missing_keyctl.h"
+#include "missing_stat.h"
+
+/* linux/kcmp.h */
+#ifndef KCMP_FILE /* 3f4994cfc15f38a3159c6e3a4b3ab2e1481a6b02 (3.19) */
+#define KCMP_FILE 0
+#endif
 
 #if !HAVE_PIVOT_ROOT
 static inline int missing_pivot_root(const char *new_root, const char *put_old) {
@@ -256,11 +265,10 @@ static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long i
 #  define kcmp missing_kcmp
 #endif
 
-
 /* ======================================================================= */
 
 #if !HAVE_KEYCTL
-static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) {
+static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) {
 #  ifdef __NR_keyctl
         return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
 #  else
@@ -403,8 +411,14 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
 
 #if !HAVE_STATX
 #  ifndef __NR_statx
-#    if defined __i386__
+#    if defined __aarch64__ || defined __arm__
+#      define __NR_statx 397
+#    elif defined __alpha__
+#      define __NR_statx 522
+#    elif defined __i386__ || defined __powerpc64__
 #      define __NR_statx 383
+#    elif defined __sparc__
+#      define __NR_statx 360
 #    elif defined __x86_64__
 #      define __NR_statx 332
 #    else