summaryrefslogtreecommitdiffstats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorMax Filippov2018-04-01 22:13:49 +0200
committerMax Filippov2018-04-01 23:23:17 +0200
commit12e3340c23972d7de6c2e306bafecd50abcbea1c (patch)
tree6922ab0518c5892f2fc57386fd5bdbd32745fa6f /linux-user/syscall.c
parentlinux-user: fix error propagation in clock_gettime (diff)
downloadqemu-12e3340c23972d7de6c2e306bafecd50abcbea1c.tar.gz
qemu-12e3340c23972d7de6c2e306bafecd50abcbea1c.tar.xz
qemu-12e3340c23972d7de6c2e306bafecd50abcbea1c.zip
linux-user: implement clock_settime
This fixes glibc testsuite test rt/tst-clock2. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 52e2f9c164..924fd68efc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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:
{