In the attachments debian patches to implementation subject syscalls. Any
ideas why hasn't commited?
#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
#DPATCHLEVEL=0
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c.orig   2006-11-05 07:07:41.000000000 +0200
+++ linux-user/syscall.c        2006-11-05 07:07:44.000000000 +0200
@@ -33,6 +33,7 @@
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
+#include <sys/prctl.h>
 #include <sys/resource.h>
 #include <sys/mman.h>
 #include <sys/swap.h>
@@ -3486,7 +3487,8 @@ long do_syscall(void *cpu_env, int num, 
     case TARGET_NR_nfsservctl:
         goto unimplemented;
     case TARGET_NR_prctl:
-        goto unimplemented;
+        ret = get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
+        break;
 #ifdef TARGET_NR_pread
     case TARGET_NR_pread:
         page_unprotect_range(arg2, arg3);
#DPATCHLEVEL=0
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c.orig   2006-11-05 07:07:44.000000000 +0200
+++ linux-user/syscall.c        2006-11-05 07:07:48.000000000 +0200
@@ -2200,7 +2200,9 @@ long do_syscall(void *cpu_env, int num, 
         break;
     case TARGET_NR_mount:
         /* need to look at the data field */
-        goto unimplemented;
+        ret = get_errno(mount((const char *)arg1, (const char *)arg2,
+            (const char *)arg3, (unsigned long)arg4, (const void *)arg5));
+        break;
     case TARGET_NR_umount:
         p = lock_user_string(arg1);
         ret = get_errno(umount(p));

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to