chiark / gitweb /
tree-wide: beautify remaining copyright statements
[elogind.git] / src / basic / missing_syscall.h
index 577ad009cc431a6b76c8e0cb5c915aaa952a5b16..23e0c6b916372da15980f9f2b58b00112b3b8de6 100644 (file)
@@ -2,23 +2,7 @@
 #pragma once
 
 /***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-  Copyright 2016 Zbigniew Jędrzejewski-Szmek
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+  Copyright © 2016 Zbigniew Jędrzejewski-Szmek
 ***/
 
 /* Missing glibc definitions to access certain kernel APIs */
@@ -28,7 +12,7 @@
 
 #if !HAVE_PIVOT_ROOT
 static inline int missing_pivot_root(const char *new_root, const char *put_old) {
-        return syscall(SYS_pivot_root, new_root, put_old);
+        return syscall(__NR_pivot_root, new_root, put_old);
 }
 
 #  define pivot_root missing_pivot_root
@@ -131,7 +115,7 @@ static inline int missing_getrandom(void *buffer, size_t count, unsigned flags)
 
 #if !HAVE_GETTID
 static inline pid_t missing_gettid(void) {
-        return (pid_t) syscall(SYS_gettid);
+        return (pid_t) syscall(__NR_gettid);
 }
 
 #  define gettid missing_gettid
@@ -271,7 +255,6 @@ static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long i
 #  define kcmp missing_kcmp
 #endif
 
-
 /* ======================================================================= */
 
 #if !HAVE_KEYCTL
@@ -396,6 +379,8 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
 #      define __NR_pkey_mprotect 394
 #    elif defined __aarch64__
 #      define __NR_pkey_mprotect 394
+#    elif defined __powerpc__
+#      define __NR_pkey_mprotect 386
 #    elif defined _MIPS_SIM
 #      if _MIPS_SIM == _MIPS_SIM_ABI32
 #        define __NR_pkey_mprotect 4363
@@ -416,10 +401,16 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
 
 #if !HAVE_STATX
 #  ifndef __NR_statx
-#    if defined __i386__
-#      define __NR_bpf 383
+#    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_bpf 332
+#      define __NR_statx 332
 #    else
 #      warning "__NR_statx not defined for your architecture"
 #    endif