From: Alan Cox Date: Fri, 26 Dec 2014 20:30:00 +0000 (+0000) Subject: time: correct bug, add stime time type X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=cdb93e0fd5bc8c4e5ede5211fae5c7cd61fa4de5;p=FUZIX.git time: correct bug, add stime time type This finishes the basic provision for multiple time sources --- diff --git a/Kernel/include/syscall_name.h b/Kernel/include/syscall_name.h index b3a446eb..dd339dc9 100644 --- a/Kernel/include/syscall_name.h +++ b/Kernel/include/syscall_name.h @@ -92,7 +92,7 @@ int syscall_args[NR_SYSCALL] = { 1, //setuid 1, //setgid 2, //_time - 1, //stime + 2, //stime 3, //ioctl 1, //brk 1, //sbrk diff --git a/Kernel/syscall_proc.c b/Kernel/syscall_proc.c index e9d05cc7..98555cf5 100644 --- a/Kernel/syscall_proc.c +++ b/Kernel/syscall_proc.c @@ -149,7 +149,8 @@ int16_t _time(void) uzero(&t.high, sizeof(t.high)); return 0; default: - return -EINVAL; + udata.u_error = EINVAL; + return -1; } } @@ -165,10 +166,15 @@ Set Clock Time (Currently unimplemented). When active, must be SuperUser to Set Time. ********************************************/ #define tvec (time_t *)udata.u_argn +#define type (uint16_t)udata.u_argn1 int16_t _stime(void) { time_t t; + if (type != 0) { + udata.u_error = EINVAL; + return -1; + } if (uget(&t, tvec, sizeof(t)) || esuper()) return -1; wrtime(&t); @@ -176,7 +182,7 @@ int16_t _stime(void) } #undef tvec - +#undef type /*******************************************