diff options
| author | Miguel <m.i@gmx.at> | 2018-08-17 03:57:35 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-17 03:57:35 +0200 |
| commit | 413f1f19184acd9024b9a97156c467b88ff72484 (patch) | |
| tree | fcc8ba0a4ea8a1785d5818c7793e946da84e07e6 /kernel/syscalls.c | |
| parent | c742be9c738c91703a7be787639cad167de3a6b1 (diff) | |
math, time, seed and randomness - simple test
Diffstat (limited to 'kernel/syscalls.c')
| -rw-r--r-- | kernel/syscalls.c | 16 |
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) |
