* simops.c (OP_10007E0): Handle SYS_times and SYS_gettimeofday.

Check it into devo too.
This commit is contained in:
Jeff Law
1996-10-30 16:30:59 +00:00
parent 6803f89b14
commit 8824fb459b
2 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,7 @@
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)

View File

@ -5,6 +5,7 @@
#include "bfd.h"
#include <errno.h>
#include <sys/stat.h>
#include <sys/times.h>
enum op_types {
OP_UNKNOWN,
@ -2086,6 +2087,27 @@ OP_10007E0 ()
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. */