chore: comment for syscall nr

This commit is contained in:
Paul Pan 2022-10-04 14:30:11 +08:00
parent 5fd6b7acda
commit 32aa186d87
2 changed files with 17 additions and 3 deletions

View File

@ -3,6 +3,9 @@ project(woj_sandbox C)
set(CMAKE_C_STANDARD 23) set(CMAKE_C_STANDARD 23)
# Handle __FILE__ in logging
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.")
# Source files # Source files
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/*.c ${PROJECT_SOURCE_DIR}/rules/*.c ${PROJECT_SOURCE_DIR}/utils/*.c) 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$") list(FILTER SRC_FILES EXCLUDE REGEX ".*test\\.c$")

View File

@ -6,9 +6,20 @@
void setup_lang_c(scmp_filter_ctx ctx) { void setup_lang_c(scmp_filter_ctx ctx) {
int white[] = { int white[] = {
SCMP_SYS(read), SCMP_SYS(write), SCMP_SYS(lseek), SCMP_SYS(read), // 0
SCMP_SYS(mmap), SCMP_SYS(munmap), SCMP_SYS(getpid), SCMP_SYS(write), // 1
SCMP_SYS(futex), SCMP_SYS(newfstatat), SCMP_SYS(exit_group), 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]); int white_len = sizeof(white) / sizeof(white[0]);