OSDN Git Service

linux-user: implement clock_settime
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 1 Apr 2018 20:13:49 +0000 (13:13 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sun, 1 Apr 2018 21:23:17 +0000 (14:23 -0700)
This fixes glibc testsuite test rt/tst-clock2.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
linux-user/syscall.c

index 52e2f9c..924fd68 100644 (file)
@@ -11878,6 +11878,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         goto unimplemented_nowarn;
 #endif
 
+#ifdef TARGET_NR_clock_settime
+    case TARGET_NR_clock_settime:
+    {
+        struct timespec ts;
+
+        ret = target_to_host_timespec(&ts, arg2);
+        if (!is_error(ret)) {
+            ret = get_errno(clock_settime(arg1, &ts));
+        }
+        break;
+    }
+#endif
 #ifdef TARGET_NR_clock_gettime
     case TARGET_NR_clock_gettime:
     {