Commit 72f0390014bd416413ad5ae3435d3ab113776f6a
1 parent
b17780d5
suppressed clashes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@8 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
24 additions
and
13 deletions
linux-user/syscall.c
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | #include <sched.h> |
| 38 | 38 | #include <sys/socket.h> |
| 39 | 39 | #include <sys/uio.h> |
| 40 | -#include <sys/user.h> | |
| 40 | +//#include <sys/user.h> | |
| 41 | 41 | |
| 42 | 42 | #define termios host_termios |
| 43 | 43 | #define winsize host_winsize |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | |
| 53 | 53 | #include "gemu.h" |
| 54 | 54 | |
| 55 | -#define DEBUG | |
| 55 | +//#define DEBUG | |
| 56 | 56 | |
| 57 | 57 | #ifndef PAGE_SIZE |
| 58 | 58 | #define PAGE_SIZE 4096 |
| ... | ... | @@ -73,18 +73,25 @@ struct dirent { |
| 73 | 73 | #endif |
| 74 | 74 | |
| 75 | 75 | #define __NR_sys_uname __NR_uname |
| 76 | -#define __NR_sys_getcwd __NR_getcwd | |
| 76 | +#define __NR_sys_getcwd1 __NR_getcwd | |
| 77 | 77 | #define __NR_sys_statfs __NR_statfs |
| 78 | 78 | #define __NR_sys_fstatfs __NR_fstatfs |
| 79 | +#define __NR_sys_getdents __NR_getdents | |
| 79 | 80 | |
| 81 | +#ifdef __NR_gettid | |
| 80 | 82 | _syscall0(int, gettid) |
| 83 | +#else | |
| 84 | +static int gettid(void) { | |
| 85 | + return -ENOSYS; | |
| 86 | +} | |
| 87 | +#endif | |
| 81 | 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 | 91 | _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, |
| 85 | 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 | 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 | 389 | ie++; |
| 383 | 390 | } |
| 384 | 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 | 395 | switch(arg_type[0]) { |
| 387 | 396 | case TYPE_NULL: |
| 388 | 397 | /* no argument */ |
| ... | ... | @@ -612,9 +621,11 @@ long do_syscall(int num, long arg1, long arg2, long arg3, |
| 612 | 621 | { |
| 613 | 622 | long ret; |
| 614 | 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 | 629 | switch(num) { |
| 619 | 630 | case TARGET_NR_exit: |
| 620 | 631 | _exit(arg1); |
| ... | ... | @@ -1161,7 +1172,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3, |
| 1161 | 1172 | { |
| 1162 | 1173 | struct dirent *dirp = (void *)arg2; |
| 1163 | 1174 | long count = arg3; |
| 1164 | - ret = get_errno(getdents(arg1, dirp, count)); | |
| 1175 | + ret = get_errno(sys_getdents(arg1, dirp, count)); | |
| 1165 | 1176 | if (!is_error(ret)) { |
| 1166 | 1177 | struct dirent *de; |
| 1167 | 1178 | int len = ret; |
| ... | ... | @@ -1277,7 +1288,7 @@ long do_syscall(int num, long arg1, long arg2, long arg3, |
| 1277 | 1288 | ret = get_errno(chown((const char *)arg1, arg2, arg3)); |
| 1278 | 1289 | break; |
| 1279 | 1290 | case TARGET_NR_getcwd: |
| 1280 | - ret = get_errno(sys_getcwd((char *)arg1, arg2)); | |
| 1291 | + ret = get_errno(sys_getcwd1((char *)arg1, arg2)); | |
| 1281 | 1292 | break; |
| 1282 | 1293 | case TARGET_NR_capget: |
| 1283 | 1294 | case TARGET_NR_capset: | ... | ... |