summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-30 21:29:48 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-03-30 21:29:48 +0000
commit32f36bcefcd5710a00bb168bc40c407ae899b630 (patch)
tree8de3234a26e5f3062c14f0fbb06b5c10badd6e4e /linux-user
parentbc8a22cc307ebd9a2577c8fffcb90000724f72f3 (diff)
added SIOCATMARK and times() syscall
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@70 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/ioctls.h1
-rw-r--r--linux-user/syscall.c14
-rw-r--r--linux-user/syscall_defs.h9
3 files changed, 23 insertions, 1 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index f075aff4d5..b9aadb7a58 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -66,6 +66,7 @@
IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
#endif
+ IOCTL(SIOCATMARK, 0, TYPE_NULL)
IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
IOCTL(SIOCDELRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 898dbcdf03..16958be80c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -40,6 +40,7 @@
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/poll.h>
+#include <sys/times.h>
//#include <sys/user.h>
#include <netinet/tcp.h>
@@ -1367,7 +1368,18 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
}
break;
case TARGET_NR_times:
- goto unimplemented;
+ {
+ struct target_tms *tmsp = (void *)arg1;
+ struct tms tms;
+ ret = get_errno(times(&tms));
+ if (tmsp) {
+ tmsp->tms_utime = tswapl(tms.tms_utime);
+ tmsp->tms_stime = tswapl(tms.tms_stime);
+ tmsp->tms_cutime = tswapl(tms.tms_cutime);
+ tmsp->tms_cstime = tswapl(tms.tms_cstime);
+ }
+ }
+ break;
case TARGET_NR_prof:
goto unimplemented;
case TARGET_NR_setgid:
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 2c442d8aa8..a442683b6d 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -39,6 +39,15 @@ struct target_itimerval {
struct target_timeval it_value;
};
+typedef target_long target_clock_t;
+
+struct target_tms {
+ target_clock_t tms_utime;
+ target_clock_t tms_stime;
+ target_clock_t tms_cutime;
+ target_clock_t tms_cstime;
+};
+
struct target_iovec {
target_long iov_base; /* Starting address */
target_long iov_len; /* Number of bytes */