Commit 72f0390014bd416413ad5ae3435d3ab113776f6a

Authored by bellard
1 parent b17780d5

suppressed clashes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@8 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/syscall.c
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 #include <sched.h> 37 #include <sched.h>
38 #include <sys/socket.h> 38 #include <sys/socket.h>
39 #include <sys/uio.h> 39 #include <sys/uio.h>
40 -#include <sys/user.h> 40 +//#include <sys/user.h>
41 41
42 #define termios host_termios 42 #define termios host_termios
43 #define winsize host_winsize 43 #define winsize host_winsize
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 52
53 #include "gemu.h" 53 #include "gemu.h"
54 54
55 -#define DEBUG 55 +//#define DEBUG
56 56
57 #ifndef PAGE_SIZE 57 #ifndef PAGE_SIZE
58 #define PAGE_SIZE 4096 58 #define PAGE_SIZE 4096
@@ -73,18 +73,25 @@ struct dirent { @@ -73,18 +73,25 @@ struct dirent {
73 #endif 73 #endif
74 74
75 #define __NR_sys_uname __NR_uname 75 #define __NR_sys_uname __NR_uname
76 -#define __NR_sys_getcwd __NR_getcwd 76 +#define __NR_sys_getcwd1 __NR_getcwd
77 #define __NR_sys_statfs __NR_statfs 77 #define __NR_sys_statfs __NR_statfs
78 #define __NR_sys_fstatfs __NR_fstatfs 78 #define __NR_sys_fstatfs __NR_fstatfs
  79 +#define __NR_sys_getdents __NR_getdents
79 80
  81 +#ifdef __NR_gettid
80 _syscall0(int, gettid) 82 _syscall0(int, gettid)
  83 +#else
  84 +static int gettid(void) {
  85 + return -ENOSYS;
  86 +}
  87 +#endif
81 _syscall1(int,sys_uname,struct new_utsname *,buf) 88 _syscall1(int,sys_uname,struct new_utsname *,buf)
82 -_syscall2(int,sys_getcwd,char *,buf,size_t,size)  
83 -_syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count); 89 +_syscall2(int,sys_getcwd1,char *,buf,size_t,size)
  90 +_syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count);
84 _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, 91 _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
85 loff_t *, res, uint, wh); 92 loff_t *, res, uint, wh);
86 -_syscall2(int,sys_statfs,const char *,path,struct statfs *,buf)  
87 -_syscall2(int,sys_fstatfs,int,fd,struct statfs *,buf) 93 +_syscall2(int,sys_statfs,const char *,path,struct kernel_statfs *,buf)
  94 +_syscall2(int,sys_fstatfs,int,fd,struct kernel_statfs *,buf)
88 95
89 static inline long get_errno(long ret) 96 static inline long get_errno(long ret)
90 { 97 {
@@ -382,7 +389,9 @@ static long do_ioctl(long fd, long cmd, long arg) @@ -382,7 +389,9 @@ static long do_ioctl(long fd, long cmd, long arg)
382 ie++; 389 ie++;
383 } 390 }
384 arg_type = ie->arg_type; 391 arg_type = ie->arg_type;
385 - // gemu_log("ioctl: cmd=0x%04lx (%s)\n", cmd, ie->name); 392 +#ifdef DEBUG
  393 + gemu_log("ioctl: cmd=0x%04lx (%s)\n", cmd, ie->name);
  394 +#endif
386 switch(arg_type[0]) { 395 switch(arg_type[0]) {
387 case TYPE_NULL: 396 case TYPE_NULL:
388 /* no argument */ 397 /* no argument */
@@ -612,9 +621,11 @@ long do_syscall(int num, long arg1, long arg2, long arg3, @@ -612,9 +621,11 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
612 { 621 {
613 long ret; 622 long ret;
614 struct stat st; 623 struct stat st;
615 - struct statfs *stfs; 624 + struct kernel_statfs *stfs;
616 625
617 - // gemu_log("syscall %d\n", num); 626 +#ifdef DEBUG
  627 + gemu_log("syscall %d\n", num);
  628 +#endif
618 switch(num) { 629 switch(num) {
619 case TARGET_NR_exit: 630 case TARGET_NR_exit:
620 _exit(arg1); 631 _exit(arg1);
@@ -1161,7 +1172,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3, @@ -1161,7 +1172,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
1161 { 1172 {
1162 struct dirent *dirp = (void *)arg2; 1173 struct dirent *dirp = (void *)arg2;
1163 long count = arg3; 1174 long count = arg3;
1164 - ret = get_errno(getdents(arg1, dirp, count)); 1175 + ret = get_errno(sys_getdents(arg1, dirp, count));
1165 if (!is_error(ret)) { 1176 if (!is_error(ret)) {
1166 struct dirent *de; 1177 struct dirent *de;
1167 int len = ret; 1178 int len = ret;
@@ -1277,7 +1288,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3, @@ -1277,7 +1288,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3,
1277 ret = get_errno(chown((const char *)arg1, arg2, arg3)); 1288 ret = get_errno(chown((const char *)arg1, arg2, arg3));
1278 break; 1289 break;
1279 case TARGET_NR_getcwd: 1290 case TARGET_NR_getcwd:
1280 - ret = get_errno(sys_getcwd((char *)arg1, arg2)); 1291 + ret = get_errno(sys_getcwd1((char *)arg1, arg2));
1281 break; 1292 break;
1282 case TARGET_NR_capget: 1293 case TARGET_NR_capget:
1283 case TARGET_NR_capset: 1294 case TARGET_NR_capset:
linux-user/syscall_defs.h
@@ -52,7 +52,7 @@ typedef struct { @@ -52,7 +52,7 @@ typedef struct {
52 int val[2]; 52 int val[2];
53 } kernel_fsid_t; 53 } kernel_fsid_t;
54 54
55 -struct statfs { 55 +struct kernel_statfs {
56 int f_type; 56 int f_type;
57 int f_bsize; 57 int f_bsize;
58 int f_blocks; 58 int f_blocks;