summaryrefslogtreecommitdiff
path: root/kernel/syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/syscalls.c')
-rw-r--r--kernel/syscalls.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/syscalls.c b/kernel/syscalls.c
index 31579e1..e3db767 100644
--- a/kernel/syscalls.c
+++ b/kernel/syscalls.c
@@ -6,6 +6,7 @@
#include "kernel/kernel.h"
#include "kernel/config.h"
#include <sys/stat.h>
+#include <sys/time.h>
#include <stdbool.h>
#include <stddef.h>
@@ -15,9 +16,20 @@ int syscall_unhandled(int nr)
panic(FOOLOS_MODULE_NAME,"unhandled syscall (generic handler)");
}
-int syscall_gettimeofday(void *timeval, void *tz)
+int syscall_gettimeofday(struct timeval *tv, struct timezone *tz)
{
- return -1;
+ if(tv!=NULL)
+ {
+ uint32_t t=timer_get_ms();
+ tv->tv_sec=t/1000;
+ tv->tv_usec=0;//t-tv->tv_sec*1000;
+ }
+ if(tz!=NULL)
+ {
+ tz->tz_minuteswest=0;
+ tz->tz_dsttime=DST_NONE;
+ }
+ return 0;
}
int syscall_lseek(int file,int ptr,int dir)