Commit 32f36bcefcd5710a00bb168bc40c407ae899b630

Authored by bellard
1 parent bc8a22cc

added SIOCATMARK and times() syscall


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@70 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/ioctls.h
... ... @@ -66,6 +66,7 @@
66 66 IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
67 67 #endif
68 68  
  69 + IOCTL(SIOCATMARK, 0, TYPE_NULL)
69 70 IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
70 71 IOCTL(SIOCDELRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
71 72 IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
... ...
linux-user/syscall.c
... ... @@ -40,6 +40,7 @@
40 40 #include <sys/socket.h>
41 41 #include <sys/uio.h>
42 42 #include <sys/poll.h>
  43 +#include <sys/times.h>
43 44 //#include <sys/user.h>
44 45 #include <netinet/tcp.h>
45 46  
... ... @@ -1367,7 +1368,18 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1367 1368 }
1368 1369 break;
1369 1370 case TARGET_NR_times:
1370   - goto unimplemented;
  1371 + {
  1372 + struct target_tms *tmsp = (void *)arg1;
  1373 + struct tms tms;
  1374 + ret = get_errno(times(&tms));
  1375 + if (tmsp) {
  1376 + tmsp->tms_utime = tswapl(tms.tms_utime);
  1377 + tmsp->tms_stime = tswapl(tms.tms_stime);
  1378 + tmsp->tms_cutime = tswapl(tms.tms_cutime);
  1379 + tmsp->tms_cstime = tswapl(tms.tms_cstime);
  1380 + }
  1381 + }
  1382 + break;
1371 1383 case TARGET_NR_prof:
1372 1384 goto unimplemented;
1373 1385 case TARGET_NR_setgid:
... ...
linux-user/syscall_defs.h
... ... @@ -39,6 +39,15 @@ struct target_itimerval {
39 39 struct target_timeval it_value;
40 40 };
41 41  
  42 +typedef target_long target_clock_t;
  43 +
  44 +struct target_tms {
  45 + target_clock_t tms_utime;
  46 + target_clock_t tms_stime;
  47 + target_clock_t tms_cutime;
  48 + target_clock_t tms_cstime;
  49 +};
  50 +
42 51 struct target_iovec {
43 52 target_long iov_base; /* Starting address */
44 53 target_long iov_len; /* Number of bytes */
... ...
syscall-i386.h
... ... @@ -1065,3 +1065,5 @@ union target_semun {
1065 1065  
1066 1066 #define TARGET_VFAT_IOCTL_READDIR_BOTH 0x82187201
1067 1067 #define TARGET_VFAT_IOCTL_READDIR_SHORT 0x82187202
  1068 +
  1069 +#define TARGET_SIOCATMARK 0x8905
... ...