From 413f1f19184acd9024b9a97156c467b88ff72484 Mon Sep 17 00:00:00 2001 From: Miguel Date: Fri, 17 Aug 2018 03:57:35 +0200 Subject: math, time, seed and randomness - simple test --- kernel/syscalls.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'kernel/syscalls.c') 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 +#include #include #include @@ -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) -- cgit v1.2.3