diff --git a/CMakeLists.txt b/CMakeLists.txt index 0847b0a..92f98ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,9 @@ project(woj_sandbox C) set(CMAKE_C_STANDARD 23) +# Handle __FILE__ in logging +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.") + # Source files file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/*.c ${PROJECT_SOURCE_DIR}/rules/*.c ${PROJECT_SOURCE_DIR}/utils/*.c) list(FILTER SRC_FILES EXCLUDE REGEX ".*test\\.c$") diff --git a/rules/lang_c.c b/rules/lang_c.c index e055e23..e38e1a5 100644 --- a/rules/lang_c.c +++ b/rules/lang_c.c @@ -6,9 +6,20 @@ void setup_lang_c(scmp_filter_ctx ctx) { int white[] = { - SCMP_SYS(read), SCMP_SYS(write), SCMP_SYS(lseek), - SCMP_SYS(mmap), SCMP_SYS(munmap), SCMP_SYS(getpid), - SCMP_SYS(futex), SCMP_SYS(newfstatat), SCMP_SYS(exit_group), + SCMP_SYS(read), // 0 + SCMP_SYS(write), // 1 + SCMP_SYS(fstat), // 5 + SCMP_SYS(lseek), // 8 + SCMP_SYS(mmap), // 9 + SCMP_SYS(munmap), // 11 + SCMP_SYS(pread64), // 17 + SCMP_SYS(getpid), // 39 + SCMP_SYS(futex), // 202 + SCMP_SYS(newfstatat), // 262 + SCMP_SYS(clock_gettime), // 228 + SCMP_SYS(clock_getres), // 229 + SCMP_SYS(clock_nanosleep), // 230 + SCMP_SYS(exit_group), // 231 }; int white_len = sizeof(white) / sizeof(white[0]);