aboutgitcodelistschat:MatrixIRC
path: root/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/util.c b/common/util.c
index 3e81a1c..94aeea3 100644
--- a/common/util.c
+++ b/common/util.c
@@ -18,6 +18,8 @@
#include "gluten.h"
+#include "../cooker/calls.h"
+
#define logfn(name) \
void name(const char *format, ...) { \
va_list args; \
@@ -56,6 +58,24 @@ const char *cmp_type_str[CMP_MAX + 1] = {
};
const char *metadata_type_str[METADATA_MAX + 1] = { "uid", "gid", "pid" };
+
+const char *syscall_name(long nr) {
+ struct call **set, *call;
+
+ for (set = call_sets, call = set[0]; *set; call++) {
+ if (!call->name) {
+ set++;
+ call = set[0];
+ continue;
+ }
+
+ if (nr == call->number)
+ break;
+ }
+
+ return call ? call->name : "unknown";
+}
+
const char *syscall_name_str[N_SYSCALL + 1] = {
[__NR_chown] = "chown",
[__NR_connect] = "connect",