time: correct bug, add stime time type
authorAlan Cox <alan@linux.intel.com>
Fri, 26 Dec 2014 20:30:00 +0000 (20:30 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 26 Dec 2014 20:30:00 +0000 (20:30 +0000)
This finishes the basic provision for multiple time sources

Kernel/include/syscall_name.h
Kernel/syscall_proc.c

index b3a446e..dd339dc 100644 (file)
@@ -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
index e9d05cc..98555cf 100644 (file)
@@ -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
 
 
 /*******************************************