/[qemu]/qemu/linux-user/syscall.c
ViewVC logotype

Diff of /qemu/linux-user/syscall.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.63 by bellard, Sat Nov 26 18:47:20 2005 UTC revision 1.64 by bellard, Mon Nov 28 22:28:41 2005 UTC
# Line 42  Line 42 
42  #include <sys/poll.h>  #include <sys/poll.h>
43  #include <sys/times.h>  #include <sys/times.h>
44  #include <sys/shm.h>  #include <sys/shm.h>
45    #include <sys/statfs.h>
46  #include <utime.h>  #include <utime.h>
47  #include <sys/sysinfo.h>  #include <sys/sysinfo.h>
48  //#include <sys/user.h>  //#include <sys/user.h>
# Line 202  type name(type1 arg1, type2 arg2, type3 Line 203  type name(type1 arg1, type2 arg2, type3
203    
204  #define __NR_sys_uname __NR_uname  #define __NR_sys_uname __NR_uname
205  #define __NR_sys_getcwd1 __NR_getcwd  #define __NR_sys_getcwd1 __NR_getcwd
 #define __NR_sys_statfs __NR_statfs  
 #define __NR_sys_fstatfs __NR_fstatfs  
206  #define __NR_sys_getdents __NR_getdents  #define __NR_sys_getdents __NR_getdents
207  #define __NR_sys_getdents64 __NR_getdents64  #define __NR_sys_getdents64 __NR_getdents64
208  #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo  #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
# Line 225  _syscall3(int, sys_getdents, uint, fd, s Line 224  _syscall3(int, sys_getdents, uint, fd, s
224  _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);  _syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);
225  _syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,  _syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
226            loff_t *, res, uint, wh);            loff_t *, res, uint, wh);
 _syscall2(int,sys_statfs,const char *,path,struct kernel_statfs *,buf)  
 _syscall2(int,sys_fstatfs,int,fd,struct kernel_statfs *,buf)  
227  _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)  _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
228  #ifdef __NR_exit_group  #ifdef __NR_exit_group
229  _syscall1(int,exit_group,int,error_code)  _syscall1(int,exit_group,int,error_code)
# Line 1659  long do_syscall(void *cpu_env, int num, Line 1656  long do_syscall(void *cpu_env, int num,
1656  {  {
1657      long ret;      long ret;
1658      struct stat st;      struct stat st;
1659      struct kernel_statfs *stfs;      struct statfs stfs;
1660            
1661  #ifdef DEBUG  #ifdef DEBUG
1662      gemu_log("syscall %d", num);      gemu_log("syscall %d", num);
# Line 2298  long do_syscall(void *cpu_env, int num, Line 2295  long do_syscall(void *cpu_env, int num,
2295          goto unimplemented;          goto unimplemented;
2296  #endif  #endif
2297      case TARGET_NR_statfs:      case TARGET_NR_statfs:
2298          stfs = (void *)arg2;          ret = get_errno(statfs(path((const char *)arg1), &stfs));
         ret = get_errno(sys_statfs(path((const char *)arg1), stfs));  
2299      convert_statfs:      convert_statfs:
2300          if (!is_error(ret)) {          if (!is_error(ret)) {
2301              tswap32s(&stfs->f_type);              struct target_statfs *target_stfs = (void *)arg2;
2302              tswap32s(&stfs->f_bsize);              
2303              tswap32s(&stfs->f_blocks);              put_user(stfs.f_type, &target_stfs->f_type);
2304              tswap32s(&stfs->f_bfree);              put_user(stfs.f_bsize, &target_stfs->f_bsize);
2305              tswap32s(&stfs->f_bavail);              put_user(stfs.f_blocks, &target_stfs->f_blocks);
2306              tswap32s(&stfs->f_files);              put_user(stfs.f_bfree, &target_stfs->f_bfree);
2307              tswap32s(&stfs->f_ffree);              put_user(stfs.f_bavail, &target_stfs->f_bavail);
2308              tswap32s(&stfs->f_fsid.val[0]);              put_user(stfs.f_files, &target_stfs->f_files);
2309              tswap32s(&stfs->f_fsid.val[1]);              put_user(stfs.f_ffree, &target_stfs->f_ffree);
2310              tswap32s(&stfs->f_namelen);              put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid);
2311                put_user(stfs.f_namelen, &target_stfs->f_namelen);
2312          }          }
2313          break;          break;
2314      case TARGET_NR_fstatfs:      case TARGET_NR_fstatfs:
2315          stfs = (void *)arg2;          ret = get_errno(fstatfs(arg1, &stfs));
         ret = get_errno(sys_fstatfs(arg1, stfs));  
2316          goto convert_statfs;          goto convert_statfs;
2317    #ifdef TARGET_NR_statfs64
2318        case TARGET_NR_statfs64:
2319            ret = get_errno(statfs(path((const char *)arg1), &stfs));
2320        convert_statfs64:
2321            if (!is_error(ret)) {
2322                struct target_statfs64 *target_stfs = (void *)arg3;
2323    
2324                put_user(stfs.f_type, &target_stfs->f_type);
2325                put_user(stfs.f_bsize, &target_stfs->f_bsize);
2326                put_user(stfs.f_blocks, &target_stfs->f_blocks);
2327                put_user(stfs.f_bfree, &target_stfs->f_bfree);
2328                put_user(stfs.f_bavail, &target_stfs->f_bavail);
2329                put_user(stfs.f_files, &target_stfs->f_files);
2330                put_user(stfs.f_ffree, &target_stfs->f_ffree);
2331                put_user(stfs.f_fsid.__val[0], &target_stfs->f_fsid);
2332                put_user(stfs.f_namelen, &target_stfs->f_namelen);
2333            }
2334            break;
2335        case TARGET_NR_fstatfs64:
2336            ret = get_errno(fstatfs(arg1, &stfs));
2337            goto convert_statfs64;
2338    #endif
2339  #ifdef TARGET_NR_ioperm  #ifdef TARGET_NR_ioperm
2340      case TARGET_NR_ioperm:      case TARGET_NR_ioperm:
2341          goto unimplemented;          goto unimplemented;

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26