Wed Oct 30 08:49:10 1996 Jeffrey A Law (law@cygnus.com)
+ * simops.c (OP_10007E0): Handle SYS_times and SYS_gettimeofday.
+
* simops.c (OP_10007E0): Handle SYS_time.
Tue Oct 29 14:22:55 1996 Jeffrey A Law (law@cygnus.com)
#include "bfd.h"
#include <errno.h>
#include <sys/stat.h>
+#include <sys/times.h>
enum op_types {
OP_UNKNOWN,
case SYS_time:
RETVAL = time (MEMPTR (PARM1));
break;
+ case SYS_times:
+ {
+ struct tms tms;
+ RETVAL = times (&tms);
+ store_mem (PARM1, 4, tms.tms_utime);
+ store_mem (PARM1 + 4, 4, tms.tms_stime);
+ store_mem (PARM1 + 8, 4, tms.tms_cutime);
+ store_mem (PARM1 + 12, 4, tms.tms_cstime);
+ break;
+ }
+ case SYS_gettimeofday:
+ {
+ struct timeval t;
+ struct timezone tz;
+ RETVAL = gettimeofday (&t, &tz);
+ store_mem (PARM1, 4, t.tv_sec);
+ store_mem (PARM1 + 4, 4, t.tv_usec);
+ store_mem (PARM2, 4, tz.tz_minuteswest);
+ store_mem (PARM2 + 4, 4, tz.tz_dsttime);
+ break;
+ }
case SYS_utime:
/* Cast the second argument to void *, to avoid type mismatch
if a prototype is present. */