aboutgitcodelistschat:MatrixIRC
path: root/common/util.c
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-08-30 10:43:07 +0200
committerAlice Frosi <afrosi@redhat.com>2023-08-30 10:44:07 +0200
commit0e8806838763655f5f35822e19a20cb21e8d4747 (patch)
treebdb24fb928c0472c079a87f101f56af7e37fb17f /common/util.c
parentdf9e3287663155d89fe990712e90080f4a621a79 (diff)
downloadseitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar.gz
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar.bz2
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar.lz
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar.xz
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.tar.zst
seitan-0e8806838763655f5f35822e19a20cb21e8d4747.zip
common: print syscall name based on the number
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index d74e199..8e15837 100644
--- a/common/util.c
+++ b/common/util.c
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
+#include <sys/syscall.h>
#include "gluten.h"
@@ -52,3 +53,18 @@ const char *bitwise_type_str[BITWISE_MAX + 1] = { "&", "|" };
const char *cmp_type_str[CMP_MAX + 1] = {
"EQ", "NE", "GT", "GE", "LT", "LE",
};
+
+const char *metadata_type_str[METADATA_MAX + 1] = { "uid", "gid" };
+const char *syscall_name_str[N_SYSCALL + 1] = {
+ [__NR_chown] = "chown",
+ [__NR_connect] = "connect",
+ [__NR_ioctl] = "ioctl",
+ [__NR_lchown] = "lchown",
+ [__NR_mknod] = "mknod",
+ [__NR_mknodat] = "mknodat",
+ [__NR_read] = "read",
+ [__NR_socket] = "socket",
+ [__NR_unshare] = "unshare",
+ [__NR_open] = "open",
+
+};