summaryrefslogtreecommitdiff
path: root/src/user/app
diff options
context:
space:
mode:
authordzwdz2022-07-11 22:21:57 +0200
committerdzwdz2022-07-11 22:21:57 +0200
commit93af95b3419edfc127c6ea4245753540190c520e (patch)
treeafacc32ba93239f2cde81efd35aacb015647cf99 /src/user/app
parent2e79a2e5af3affa7a6a3becdffb1c91d89af90af (diff)
user: add shorthand close() and fork() wrappers for those syscalls
Diffstat (limited to 'src/user/app')
-rw-r--r--src/user/app/main.c6
-rw-r--r--src/user/app/shell.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/user/app/main.c b/src/user/app/main.c
index e59b5a6..f87133e 100644
--- a/src/user/app/main.c
+++ b/src/user/app/main.c
@@ -37,7 +37,7 @@ int main(void) {
MOUNT("/bind/", fs_passthru(NULL));
- if (_syscall_fork(0, NULL)) {
+ if (fork()) {
/* (used to) expose a bug in the kernel
* the program will flow like this:
* 1. we launch the forked init
@@ -54,7 +54,7 @@ int main(void) {
_syscall_exit(1);
}
- if (!_syscall_fork(0, NULL)) {
+ if (!fork()) {
if (!file_reopen(stdout, "/kdev/com1", 0)) {
printf("couldn't open /kdev/com1\n"); // TODO borked
_syscall_exit(1);
@@ -69,7 +69,7 @@ int main(void) {
}
- if (!_syscall_fork(0, NULL)) {
+ if (!fork()) {
if (!file_reopen(stdout, "/vga_tty", 0)) {
printf("couldn't open /vga_tty\n"); // TODO borked
_syscall_exit(1);
diff --git a/src/user/app/shell.c b/src/user/app/shell.c
index 0a8c44f..5bab2ab 100644
--- a/src/user/app/shell.c
+++ b/src/user/app/shell.c
@@ -111,7 +111,7 @@ static void cmd_hexdump(const char *args) {
printf("|\n");
}
- _syscall_close(fd);
+ close(fd);
}
static void cmd_touch(const char *args) {
@@ -120,7 +120,7 @@ static void cmd_touch(const char *args) {
printf("couldn't create file.\n");
return;
}
- _syscall_close(fd);
+ close(fd);
}
void shell_loop(void) {
@@ -157,7 +157,7 @@ void shell_loop(void) {
} else if (!strcmp(cmd, "exit")) {
_syscall_exit(0);
} else if (!strcmp(cmd, "fork")) {
- if (_syscall_fork(0, NULL))
+ if (fork())
_syscall_await();
else level++;
} else if (!strcmp(cmd, "run_tests")) {