summaryrefslogtreecommitdiff
path: root/userspace/syscalls.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-21 15:21:07 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-21 15:21:07 +0100
commit6e8ea08166b53507f38ed7f435728b7470a061ab (patch)
treed0669f3a70963056dbd7ffc59ab04e5cd172c52e /userspace/syscalls.c
parent1f460d7d4fcbf29e21b3da77eab247f528f02f19 (diff)
trying to port binutils
Diffstat (limited to 'userspace/syscalls.c')
-rw-r--r--userspace/syscalls.c46
1 files changed, 43 insertions, 3 deletions
diff --git a/userspace/syscalls.c b/userspace/syscalls.c
index 8c8bfc9..51436fb 100644
--- a/userspace/syscalls.c
+++ b/userspace/syscalls.c
@@ -1,6 +1,3 @@
-#include <sys/stat.h>
-#include <string.h>
-#include <stdint.h>
#include "../kernel/syscalls.h"
/*
@@ -93,4 +90,47 @@ uint32_t sbrk(int incr)
return syscall(SYSCALL_SBRK,incr,0,0);
}
+int gettimeofday(struct timeval *tv, void *tz)
+{
+ return syscall(SYSCALL_GETTIMEOFDAY,tv,tz,0);
+}
+int fork(void)
+{
+ return syscall(SYSCALL_FORK,0,0,0);
+}
+
+int getpid(void)
+{
+ return syscall(SYSCALL_GETPID,0,0,0);
+}
+
+int kill(int pid, int sig)
+{
+ return syscall(SYSCALL_KILL,pid,sig,0);
+}
+
+int link(char *old, char *ne)
+{
+ return syscall(SYSCALL_LINK,old,ne,0);
+}
+
+int stat(const char *file, struct stat *st)
+{
+ return syscall(SYSCALL_STAT,file,st,0);
+}
+
+int times(struct tms *buf)
+{
+ return syscall(SYSCALL_TIMES,buf,0,0);
+}
+
+int unlink(char *name)
+{
+ return syscall(SYSCALL_UNLINK,name,0,0);
+}
+
+int wait(int *status)
+{
+ return syscall(SYSCALL_WAIT,status,0,0);
+}