aboutgitcodelistschat:MatrixIRC
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/util.c16
-rw-r--r--common/util.h3
2 files changed, 18 insertions, 1 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",
+
+};
diff --git a/common/util.h b/common/util.h
index a587665..4b59e77 100644
--- a/common/util.h
+++ b/common/util.h
@@ -128,5 +128,6 @@ void debug(const char *format, ...);
-1)
#define BITS_PER_NUM(n) (const_ilog2(n) + 1)
-
+#define N_SYSCALL 512
+extern const char *syscall_name_str[N_SYSCALL + 1];
#endif /* UTIL_H */