From 172b09674a3f2c38d5827504967fdb0b44ab1231 Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri, 20 Oct 2017 09:39:40 +0200
Subject: [PATCH] arch: add the statx syscall
Fixes #88
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
[PM: fixed the incorrect x32 definition]
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
src/arch-aarch64-syscalls.c | 1 +
src/arch-arm-syscalls.c | 1 +
src/arch-mips-syscalls.c | 1 +
src/arch-mips64-syscalls.c | 1 +
src/arch-mips64n32-syscalls.c | 1 +
src/arch-ppc-syscalls.c | 1 +
src/arch-ppc64-syscalls.c | 1 +
src/arch-s390-syscalls.c | 1 +
src/arch-s390x-syscalls.c | 1 +
src/arch-x32-syscalls.c | 3 ++-
src/arch-x86-syscalls.c | 1 +
src/arch-x86_64-syscalls.c | 1 +
12 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c
index 357f290..d8d01bf 100644
--- a/src/arch-aarch64-syscalls.c
+++ b/src/arch-aarch64-syscalls.c
@@ -387,6 +387,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", 43 },
{ "statfs64", __PNR_statfs64 },
+ { "statx", 291 },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c
index d1349a1..12e3ed9 100644
--- a/src/arch-arm-syscalls.c
+++ b/src/arch-arm-syscalls.c
@@ -399,6 +399,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
{ "stat64", (__SCMP_NR_BASE + 195) },
{ "statfs", (__SCMP_NR_BASE + 99) },
{ "statfs64", (__SCMP_NR_BASE + 266) },
+ { "statx", (__SCMP_NR_BASE + 397) },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c
index 2cd86cd..8efaacd 100644
--- a/src/arch-mips-syscalls.c
+++ b/src/arch-mips-syscalls.c
@@ -391,6 +391,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
{ "stat64", (__SCMP_NR_BASE + 213) },
{ "statfs", (__SCMP_NR_BASE + 99) },
{ "statfs64", (__SCMP_NR_BASE + 255) },
+ { "statx", (__SCMP_NR_BASE + 366) },
{ "stime", (__SCMP_NR_BASE + 25) },
{ "stty", (__SCMP_NR_BASE + 31) },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c
index 80db447..1b1bcd0 100644
--- a/src/arch-mips64-syscalls.c
+++ b/src/arch-mips64-syscalls.c
@@ -391,6 +391,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", (__SCMP_NR_BASE + 134) },
{ "statfs64", __PNR_statfs64 },
+ { "statx", (__SCMP_NR_BASE + 326) },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c
index 5cf03d2..b280074 100644
--- a/src/arch-mips64n32-syscalls.c
+++ b/src/arch-mips64n32-syscalls.c
@@ -391,6 +391,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", (__SCMP_NR_BASE + 134) },
{ "statfs64", (__SCMP_NR_BASE + 217) },
+ { "statx", (__SCMP_NR_BASE + 330) },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c
index 2bd8a36..9959b19 100644
--- a/src/arch-ppc-syscalls.c
+++ b/src/arch-ppc-syscalls.c
@@ -388,6 +388,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
{ "stat64", 195 },
{ "statfs", 99 },
{ "statfs64", 252 },
+ { "statx", 383},
{ "stime", 25 },
{ "stty", 31 },
{ "subpage_prot", 310 },
diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c
index 73621a1..f6d8a83 100644
--- a/src/arch-ppc64-syscalls.c
+++ b/src/arch-ppc64-syscalls.c
@@ -388,6 +388,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", 99 },
{ "statfs64", 252 },
+ { "statx", 383},
{ "stime", 25 },
{ "stty", 31 },
{ "subpage_prot", 310 },
diff --git a/src/arch-s390-syscalls.c b/src/arch-s390-syscalls.c
index a04673a..23bc4f7 100644
--- a/src/arch-s390-syscalls.c
+++ b/src/arch-s390-syscalls.c
@@ -371,6 +371,7 @@ const struct arch_syscall_def s390_syscall_table[] = { \
{ "stat64", 195 },
{ "statfs", 99 },
{ "statfs64", 265 },
+ { "statx", 379 },
{ "stime", 25 },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-s390x-syscalls.c b/src/arch-s390x-syscalls.c
index 9825c63..59b93cf 100644
--- a/src/arch-s390x-syscalls.c
+++ b/src/arch-s390x-syscalls.c
@@ -371,6 +371,7 @@ const struct arch_syscall_def s390x_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", 99 },
{ "statfs64", 265 },
+ { "statx", 379 },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c
index 80dd38b..c933956 100644
--- a/src/arch-x32-syscalls.c
+++ b/src/arch-x32-syscalls.c
@@ -26,7 +26,7 @@
#include "arch.h"
#include "arch-x32.h"
-/* NOTE: based on Linux 4.5-rc4 */
+/* NOTE: based on Linux 4.14 */
const struct arch_syscall_def x32_syscall_table[] = { \
{ "_llseek", __PNR__llseek },
{ "_newselect", __PNR__newselect },
@@ -387,6 +387,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", (X32_SYSCALL_BIT + 137) },
{ "statfs64", __PNR_statfs64 },
+ { "statx", (X32_SYSCALL_BIT + 332) },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c
index 58e0597..04e2e0a 100644
--- a/src/arch-x86-syscalls.c
+++ b/src/arch-x86-syscalls.c
@@ -387,6 +387,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
{ "stat64", 195 },
{ "statfs", 99 },
{ "statfs64", 268 },
+ { "statx", 383 },
{ "stime", 25 },
{ "stty", 31 },
{ "subpage_prot", __PNR_subpage_prot },
diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c
index 2dd9818..0aa437a 100644
--- a/src/arch-x86_64-syscalls.c
+++ b/src/arch-x86_64-syscalls.c
@@ -387,6 +387,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
{ "stat64", __PNR_stat64 },
{ "statfs", 137 },
{ "statfs64", __PNR_statfs64 },
+ { "statx", 332 },
{ "stime", __PNR_stime },
{ "stty", __PNR_stty },
{ "subpage_prot", __PNR_subpage_prot },
--
2.21.0