From aa8a8811818331cf511681327e3ba95e456f0d33 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 2 May 2020 15:44:11 +0200 Subject: Added many syscalls to get better POSIX compliance --- src/userspace/libc/unistd/exec.c | 7 +++++++ src/userspace/libc/unistd/exit.c | 9 +++++++++ src/userspace/libc/unistd/fork.c | 7 +++++++ src/userspace/libc/unistd/get_pid.c | 7 +++++++ src/userspace/libc/unistd/read.c | 7 +++++++ src/userspace/libc/unistd/write.c | 7 +++++++ 6 files changed, 44 insertions(+) create mode 100644 src/userspace/libc/unistd/exec.c create mode 100644 src/userspace/libc/unistd/exit.c create mode 100644 src/userspace/libc/unistd/fork.c create mode 100644 src/userspace/libc/unistd/get_pid.c create mode 100644 src/userspace/libc/unistd/read.c create mode 100644 src/userspace/libc/unistd/write.c (limited to 'src/userspace/libc/unistd') diff --git a/src/userspace/libc/unistd/exec.c b/src/userspace/libc/unistd/exec.c new file mode 100644 index 0000000..fd08d57 --- /dev/null +++ b/src/userspace/libc/unistd/exec.c @@ -0,0 +1,7 @@ +#include +#include + +u32 exec(char *path) +{ + return syscall_exec(path); +} \ No newline at end of file diff --git a/src/userspace/libc/unistd/exit.c b/src/userspace/libc/unistd/exit.c new file mode 100644 index 0000000..03b54fe --- /dev/null +++ b/src/userspace/libc/unistd/exit.c @@ -0,0 +1,9 @@ +#include +#include + +void exit(u32 code) +{ + syscall_exit(code); + while (1) { + }; +} \ No newline at end of file diff --git a/src/userspace/libc/unistd/fork.c b/src/userspace/libc/unistd/fork.c new file mode 100644 index 0000000..6ca054a --- /dev/null +++ b/src/userspace/libc/unistd/fork.c @@ -0,0 +1,7 @@ +#include +#include + +u32 fork() +{ + return syscall_fork(); +} \ No newline at end of file diff --git a/src/userspace/libc/unistd/get_pid.c b/src/userspace/libc/unistd/get_pid.c new file mode 100644 index 0000000..c42f460 --- /dev/null +++ b/src/userspace/libc/unistd/get_pid.c @@ -0,0 +1,7 @@ +#include +#include + +u32 get_pid() +{ + return syscall_get_pid(); +} \ No newline at end of file diff --git a/src/userspace/libc/unistd/read.c b/src/userspace/libc/unistd/read.c new file mode 100644 index 0000000..c01baa7 --- /dev/null +++ b/src/userspace/libc/unistd/read.c @@ -0,0 +1,7 @@ +#include +#include + +u32 sys_read(char *path, u32 offset, u32 count, char *buf) +{ + return syscall_read(path, offset, count, buf); +} \ No newline at end of file diff --git a/src/userspace/libc/unistd/write.c b/src/userspace/libc/unistd/write.c new file mode 100644 index 0000000..c3eec3d --- /dev/null +++ b/src/userspace/libc/unistd/write.c @@ -0,0 +1,7 @@ +#include +#include + +u32 sys_write(char *path, u32 offset, u32 count, char *buf) +{ + return syscall_write(path, offset, count, buf); +} \ No newline at end of file -- cgit v1.2.3