diff options
author | dzwdz | 2022-05-02 19:25:02 +0200 |
---|---|---|
committer | dzwdz | 2022-05-02 19:25:02 +0200 |
commit | 577ed9e01a83c13bf151b5137e6fe1eace1c4f7c (patch) | |
tree | 750dd8a3536ce70d817e6920c89042ee94899a29 /src/init/tests | |
parent | d9dc6a0c4c5047c3789a16ef623eeff7c240f5a9 (diff) |
syscalls: fork() noreap flag
Diffstat (limited to 'src/init/tests')
-rw-r--r-- | src/init/tests/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c index ed50229..ac8874f 100644 --- a/src/init/tests/main.c +++ b/src/init/tests/main.c @@ -12,7 +12,7 @@ #define assert(cond) if (!(cond)) test_fail(); static void run_forked(void (*fn)()) { - if (!_syscall_fork()) { + if (!_syscall_fork(0)) { fn(); _syscall_exit(0); } else { @@ -31,7 +31,7 @@ static void test_await(void) { int counts[16] = {0}; for (int i = 0; i < 16; i++) - if (!_syscall_fork()) + if (!_syscall_fork(0)) _syscall_exit(i); while ((ret = _syscall_await()) != ~0) { @@ -49,12 +49,12 @@ static void test_faults(void) { * reap all its children */ int await_cnt = 0; - if (!_syscall_fork()) { // invalid memory access + if (!_syscall_fork(0)) { // invalid memory access asm volatile("movb $69, 0" ::: "memory"); printf("this shouldn't happen"); _syscall_exit(-1); } - if (!_syscall_fork()) { // #GP + if (!_syscall_fork(0)) { // #GP asm volatile("hlt" ::: "memory"); printf("this shouldn't happen"); _syscall_exit(-1); @@ -94,7 +94,7 @@ static void test_orphaned_fs(void) { static void stress_fork(void) { /* run a lot of processes */ for (size_t i = 0; i < 2048; i++) { - if (!_syscall_fork()) _syscall_exit(0); + if (!_syscall_fork(0)) _syscall_exit(0); _syscall_await(); } } |