Commit 32f36bcefcd5710a00bb168bc40c407ae899b630
1 parent
bc8a22cc
added SIOCATMARK and times() syscall
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@70 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
25 additions
and
1 deletions
linux-user/ioctls.h
@@ -66,6 +66,7 @@ | @@ -66,6 +66,7 @@ | ||
66 | IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) | 66 | IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | + IOCTL(SIOCATMARK, 0, TYPE_NULL) | ||
69 | IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) | 70 | IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) |
70 | IOCTL(SIOCDELRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) | 71 | IOCTL(SIOCDELRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) |
71 | IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT)) | 72 | IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT)) |
linux-user/syscall.c
@@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
40 | #include <sys/socket.h> | 40 | #include <sys/socket.h> |
41 | #include <sys/uio.h> | 41 | #include <sys/uio.h> |
42 | #include <sys/poll.h> | 42 | #include <sys/poll.h> |
43 | +#include <sys/times.h> | ||
43 | //#include <sys/user.h> | 44 | //#include <sys/user.h> |
44 | #include <netinet/tcp.h> | 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,7 +1368,18 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, | ||
1367 | } | 1368 | } |
1368 | break; | 1369 | break; |
1369 | case TARGET_NR_times: | 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 | case TARGET_NR_prof: | 1383 | case TARGET_NR_prof: |
1372 | goto unimplemented; | 1384 | goto unimplemented; |
1373 | case TARGET_NR_setgid: | 1385 | case TARGET_NR_setgid: |
linux-user/syscall_defs.h
@@ -39,6 +39,15 @@ struct target_itimerval { | @@ -39,6 +39,15 @@ struct target_itimerval { | ||
39 | struct target_timeval it_value; | 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 | struct target_iovec { | 51 | struct target_iovec { |
43 | target_long iov_base; /* Starting address */ | 52 | target_long iov_base; /* Starting address */ |
44 | target_long iov_len; /* Number of bytes */ | 53 | target_long iov_len; /* Number of bytes */ |
syscall-i386.h
@@ -1065,3 +1065,5 @@ union target_semun { | @@ -1065,3 +1065,5 @@ union target_semun { | ||
1065 | 1065 | ||
1066 | #define TARGET_VFAT_IOCTL_READDIR_BOTH 0x82187201 | 1066 | #define TARGET_VFAT_IOCTL_READDIR_BOTH 0x82187201 |
1067 | #define TARGET_VFAT_IOCTL_READDIR_SHORT 0x82187202 | 1067 | #define TARGET_VFAT_IOCTL_READDIR_SHORT 0x82187202 |
1068 | + | ||
1069 | +#define TARGET_SIOCATMARK 0x8905 |