2005-06-10 17:12:03 +02:00
|
|
|
/*
|
|
|
|
gettimeofday.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
2005-07-06 09:08:36 +02:00
|
|
|
#include <lib.h>
|
2005-06-10 17:12:03 +02:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
int gettimeofday(struct timeval *_RESTRICT tp, void *_RESTRICT tzp)
|
|
|
|
{
|
2005-07-06 09:08:36 +02:00
|
|
|
message m;
|
2005-06-10 17:12:03 +02:00
|
|
|
|
2005-07-06 09:08:36 +02:00
|
|
|
if (_syscall(MM, GETTIMEOFDAY, &m) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
tp->tv_sec = m.m2_l1;
|
|
|
|
tp->tv_usec = m.m2_l2;
|
|
|
|
|
|
|
|
return 0;
|
2005-06-10 17:12:03 +02:00
|
|
|
}
|
2005-07-06 09:08:36 +02:00
|
|
|
|