summaryrefslogtreecommitdiff
path: root/src/user/tests/semaphore.c
diff options
context:
space:
mode:
authordzwdz2022-07-11 22:21:57 +0200
committerdzwdz2022-07-11 22:21:57 +0200
commit93af95b3419edfc127c6ea4245753540190c520e (patch)
treeafacc32ba93239f2cde81efd35aacb015647cf99 /src/user/tests/semaphore.c
parent2e79a2e5af3affa7a6a3becdffb1c91d89af90af (diff)
user: add shorthand close() and fork() wrappers for those syscalls
Diffstat (limited to 'src/user/tests/semaphore.c')
-rw-r--r--src/user/tests/semaphore.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/user/tests/semaphore.c b/src/user/tests/semaphore.c
index e5aacaa..836edf5 100644
--- a/src/user/tests/semaphore.c
+++ b/src/user/tests/semaphore.c
@@ -37,11 +37,11 @@ void test_semaphore(void) {
handle_t pipe[2];
assert(_syscall_pipe(pipe, 0) >= 0);
- if (!_syscall_fork(0, NULL)) {
+ if (!fork()) {
sem1 = esem_new(0);
sem2 = esem_new(0);
assert(sem1 && sem2);
- if (!_syscall_fork(0, NULL)) {
+ if (!fork()) {
odd(pipe[1], sem1, sem2);
_syscall_exit(69);
} else {
@@ -56,7 +56,7 @@ void test_semaphore(void) {
sem1 = esem_new(0);
sem2 = esem_new(0);
assert(sem1 && sem2);
- if (!_syscall_fork(0, NULL)) {
+ if (!fork()) {
even(pipe[1], sem1, sem2);
_syscall_exit(69);
} else {
@@ -69,7 +69,7 @@ void test_semaphore(void) {
_syscall_exit(0);
} else {
- _syscall_close(pipe[1]);
+ close(pipe[1]);
char buf[16];
size_t pos = 0;