#DPATCHLEVEL=0 Index: linux-user/syscall.c =================================================================== --- linux-user/syscall.c.orig 2006-11-05 07:07:19.000000000 +0200 +++ linux-user/syscall.c 2006-11-05 07:07:25.000000000 +0200 @@ -141,6 +141,7 @@ type name (type1 arg1,type2 arg2,type3 a #define __NR_sys_getdents __NR_getdents #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define __NR_sys_syslog __NR_syslog #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) #define __NR__llseek __NR_lseek @@ -160,6 +161,7 @@ _syscall3(int, sys_getdents64, uint, fd, _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo) +_syscall3(int,sys_syslog,int,type,char*,bufp,int,len) #ifdef __NR_exit_group _syscall1(int,exit_group,int,error_code) #endif @@ -173,6 +175,7 @@ extern int getresuid(uid_t *, uid_t *, u extern int setresgid(gid_t, gid_t, gid_t); extern int getresgid(gid_t *, gid_t *, gid_t *); extern int setgroups(int, gid_t *); +extern int uselib(const char*); static inline long get_errno(long ret) { @@ -2742,7 +2745,9 @@ long do_syscall(void *cpu_env, int num, } break; case TARGET_NR_uselib: - goto unimplemented; + ret = get_errno(uselib(path((const char*)arg1))); + break; + case TARGET_NR_swapon: p = lock_user_string(arg1); ret = get_errno(swapon(p, arg2)); @@ -2982,7 +2987,9 @@ long do_syscall(void *cpu_env, int num, #endif case TARGET_NR_syslog: - goto unimplemented; + ret = get_errno(sys_syslog((int)arg1, (char*)arg2, (int)arg3)); + break; + case TARGET_NR_setitimer: { struct itimerval value, ovalue, *pvalue; @@ -3856,7 +3863,9 @@ long do_syscall(void *cpu_env, int num, goto unimplemented; #ifdef TARGET_NR_mincore case TARGET_NR_mincore: - goto unimplemented; + page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE); + ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3)); + break; #endif #ifdef TARGET_NR_madvise case TARGET_NR_madvise: @@ -3947,7 +3956,8 @@ long do_syscall(void *cpu_env, int num, ret = get_errno(gettid()); break; case TARGET_NR_readahead: - goto unimplemented; + ret = get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3)); + break; #ifdef TARGET_NR_setxattr case TARGET_NR_setxattr: case TARGET_NR_lsetxattr: @@ -3972,6 +3982,22 @@ long do_syscall(void *cpu_env, int num, case TARGET_NR_getdomainname: goto unimplemented_nowarn; #endif +#ifdef TARGET_NR_clock_gettime + case TARGET_NR_clock_gettime: + { + struct target_timespec* ttp = (struct target_timespec*)arg2; + struct timespec htp; + if(ttp) { + htp.tv_sec = tswapl(ttp->tv_sec); + htp.tv_nsec = tswapl(ttp->tv_nsec); + ret = get_errno(clock_gettime((clockid_t)arg1, &htp)); + ttp->tv_sec = tswapl(htp.tv_sec); + ttp->tv_nsec = tswapl(htp.tv_nsec); + } else + ret = get_errno(clock_gettime((clockid_t)arg1, NULL)); + break; + } +#endif default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); Index: Makefile.target =================================================================== --- Makefile.target.orig 2006-11-05 07:06:52.000000000 +0200 +++ Makefile.target 2006-11-05 07:07:25.000000000 +0200 @@ -166,7 +166,7 @@ endif ######################################################### CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -LIBS+=-lm +LIBS+=-lm -lrt ifndef CONFIG_USER_ONLY LIBS+=-lz endif