summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2020-01-07 14:51:19 +0100
committerPaul Moore <paul@paul-moore.com>2020-02-23 10:27:58 -0500
commit5432e15521d5ce5a7d3f26bf78674cbaa9d73d1f (patch)
treef0bf4ab2fcb55620c15aae9f4c6169bea6d73285 /include
parent0a4c0300ebcc982cf419a4f7382ffc28e4792d2a (diff)
downloadlibseccomp-5432e15521d5ce5a7d3f26bf78674cbaa9d73d1f.tar.gz
arch: Add RISC-V 64-bit support
Signed-off-by: Andreas Schwab <schwab@suse.de> [PM: minor macro shuffling in seccomp.h.in] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include')
-rw-r--r--include/seccomp-syscalls.h5
-rw-r--r--include/seccomp.h.in12
2 files changed, 17 insertions, 0 deletions
diff --git a/include/seccomp-syscalls.h b/include/seccomp-syscalls.h
index 3c958df..d7eb383 100644
--- a/include/seccomp-syscalls.h
+++ b/include/seccomp-syscalls.h
@@ -273,6 +273,7 @@
#define __PNR_timerfd_settime64 -10239
#define __PNR_utimensat_time64 -10240
#define __PNR_ppoll -10241
+#define __PNR_renameat -10242
/*
* libseccomp syscall definitions
@@ -1494,7 +1495,11 @@
#define __SNR_rename __PNR_rename
#endif
+#ifdef __NR_renameat
#define __SNR_renameat __NR_renameat
+#else
+#define __SNR_renameat __PNR_renameat
+#endif
#define __SNR_renameat2 __NR_renameat2
diff --git a/include/seccomp.h.in b/include/seccomp.h.in
index 42f3a79..208b366 100644
--- a/include/seccomp.h.in
+++ b/include/seccomp.h.in
@@ -197,6 +197,18 @@ struct scmp_arg_cmp {
#define SCMP_ARCH_PARISC64 AUDIT_ARCH_PARISC64
/**
+ * The RISC-V architecture tokens
+ */
+/* RISC-V support for audit was merged in 5.0-rc1 */
+#ifndef AUDIT_ARCH_RISCV64
+#ifndef EM_RISCV
+#define EM_RISCV 243
+#endif /* EM_RISCV */
+#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+#endif /* AUDIT_ARCH_RISCV64 */
+#define SCMP_ARCH_RISCV64 AUDIT_ARCH_RISCV64
+
+/**
* Convert a syscall name into the associated syscall number
* @param x the syscall name
*/