syscall_proc: change _time to allow multiple kinds of time
authorAlan Cox <alan@linux.intel.com>
Fri, 26 Dec 2014 20:10:36 +0000 (20:10 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 26 Dec 2014 20:10:36 +0000 (20:10 +0000)
Add since boot monotomic time.

Yes this is an ABI break....

Kernel/syscall_proc.c

index aaf0f1e..e9d05cc 100644 (file)
@@ -127,23 +127,34 @@ int16_t _setgid(void)
 
 
 /*******************************************
-time (tvec)                      Function 27
+time (int type, tvec)            Function 27
+uint16_t type;
 time_t *tvec;
 ============================================
 Read Clock Time/Date to User Buffer.
 ********************************************/
 #define tvec (time_t *)udata.u_argn
+#define type (uint16_t)udata.u_argn1
 
 int16_t _time(void)
 {
        time_t t;
-       rdtime(&t);
-       uput(&t, tvec, sizeof(t));
-       return (0);
+       switch (type) {
+               case 0:
+                       rdtime(&t);
+                       uput(&t, tvec, sizeof(t));
+                       return (0);
+               case 1:
+                       uput(&t.low, &ticks, sizeof(ticks));
+                       uzero(&t.high, sizeof(t.high));
+                       return 0;
+               default:
+                       return -EINVAL;
+       }
 }
 
 #undef tvec
-
+#undef type
 
 
 /*******************************************