aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorAleksandar Markovic <aleksandar.markovic@imgtec.com>2016-10-10 13:23:29 +0200
committerRiku Voipio <riku.voipio@linaro.org>2016-10-21 15:20:09 +0300
commit38860a0343df894a1c3371597eb4d305078642fb (patch)
tree4c3beb6d708eb11d671e23a62fbc40f039311e24 /linux-user/syscall.c
parent17351c3f11e52101e1498ba03eec06fa5e4e713a (diff)
linux-user: Add support for clock_adjtime() syscall
This patch implements Qemu user mode clock_adjtime() syscall support. The implementation is based on invocation of host's clock_adjtime(). Signed-off-by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 932d0ecec3..14929965ff 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -48,6 +48,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/statfs.h>
+#include <time.h>
#include <utime.h>
#include <sys/sysinfo.h>
#include <sys/signalfd.h>
@@ -9681,6 +9682,23 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
}
break;
+#if defined(TARGET_NR_clock_adjtime) && defined(CONFIG_CLOCK_ADJTIME)
+ case TARGET_NR_clock_adjtime:
+ {
+ struct timex htx, *phtx = &htx;
+
+ if (target_to_host_timex(phtx, arg2) != 0) {
+ goto efault;
+ }
+ ret = get_errno(clock_adjtime(arg1, phtx));
+ if (!is_error(ret) && phtx) {
+ if (host_to_target_timex(arg2, phtx) != 0) {
+ goto efault;
+ }
+ }
+ }
+ break;
+#endif
#ifdef TARGET_NR_create_module
case TARGET_NR_create_module:
#endif