Commit b5906f958974df6f0fef821268bd1593ebefc143

Authored by ths
1 parent d08d3bb8

Linux usermode clock_gettime/clock_getres emulation, by Kirill A. Shutemov.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2501 c046a42c-6fe2-441c-8c8c-71466251a162
Makefile.target
... ... @@ -208,6 +208,7 @@ endif
208 208 ifdef CONFIG_LINUX_USER
209 209 OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
210 210 elfload.o linuxload.o
  211 +LIBS+= $(AIOLIBS)
211 212 ifdef TARGET_HAS_BFLT
212 213 OBJS+= flatload.o
213 214 endif
... ...
linux-user/syscall.c
... ... @@ -3990,6 +3990,29 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
3990 3990 goto unimplemented_nowarn;
3991 3991 #endif
3992 3992  
  3993 +#ifdef TARGET_NR_clock_gettime
  3994 + case TARGET_NR_clock_gettime:
  3995 + {
  3996 + struct timespec ts;
  3997 + ret = get_errno(clock_gettime(arg1, &ts));
  3998 + if (!is_error(ret)) {
  3999 + host_to_target_timespec(arg2, &ts);
  4000 + }
  4001 + break;
  4002 + }
  4003 +#endif
  4004 +#ifdef TARGET_NR_clock_getres
  4005 + case TARGET_NR_clock_getres:
  4006 + {
  4007 + struct timespec ts;
  4008 + ret = get_errno(clock_getres(arg1, &ts));
  4009 + if (!is_error(ret)) {
  4010 + host_to_target_timespec(arg2, &ts);
  4011 + }
  4012 + break;
  4013 + }
  4014 +#endif
  4015 +
3993 4016 #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
3994 4017 case TARGET_NR_set_tid_address:
3995 4018 ret = get_errno(set_tid_address((int *) arg1));
... ...