qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/4] linux-user: add clock_settime()


From: Dejan Jovicevic
Subject: [Qemu-devel] [PATCH 2/4] linux-user: add clock_settime()
Date: Tue, 25 Oct 2016 13:46:15 +0200

The implementation of the clock_settime() system call emulation
is based on converting the timespec structure values from
target to host and then calling the clock_settime() syscall on
the host.

Signed-off-by: Dejan Jovicevic <address@hidden>
---
 linux-user/syscall.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e6abfc5..898f774 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -11254,6 +11254,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 
arg1,
         break;
     }
 #endif
+#ifdef TARGET_NR_clock_settime
+    case TARGET_NR_clock_settime:
+    {
+        struct timespec ts;
+        if (target_to_host_timespec(&ts, arg2)) {
+            goto efault;
+        }
+        ret = get_errno(clock_settime(arg1, &ts));
+        break;
+    }
+#endif
 #ifdef TARGET_NR_clock_getres
     case TARGET_NR_clock_getres:
     {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]