aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/libc/unistd
diff options
context:
space:
mode:
authorMarvin Borner2020-05-02 15:44:11 +0200
committerMarvin Borner2020-05-02 15:44:11 +0200
commitaa8a8811818331cf511681327e3ba95e456f0d33 (patch)
tree852c314dae76e756863f94639ff45eff72834d5d /src/userspace/libc/unistd
parent2a0e810a473dea57fd1cd53ea424b61269c029ba (diff)
Added many syscalls to get better POSIX compliance
Diffstat (limited to 'src/userspace/libc/unistd')
-rw-r--r--src/userspace/libc/unistd/exec.c7
-rw-r--r--src/userspace/libc/unistd/exit.c9
-rw-r--r--src/userspace/libc/unistd/fork.c7
-rw-r--r--src/userspace/libc/unistd/get_pid.c7
-rw-r--r--src/userspace/libc/unistd/read.c7
-rw-r--r--src/userspace/libc/unistd/write.c7
6 files changed, 44 insertions, 0 deletions
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 <stdint.h>
+#include <syscall.h>
+
+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 <stdint.h>
+#include <syscall.h>
+
+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 <stdint.h>
+#include <syscall.h>
+
+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 <stdint.h>
+#include <syscall.h>
+
+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 <stdint.h>
+#include <syscall.h>
+
+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 <stdint.h>
+#include <syscall.h>
+
+u32 sys_write(char *path, u32 offset, u32 count, char *buf)
+{
+ return syscall_write(path, offset, count, buf);
+} \ No newline at end of file