2011-02-17 18:11:09 +01:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <lib.h>
|
|
|
|
#include "namespace.h"
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
int settimeofday(const struct timeval *tp, const void *tzp)
|
|
|
|
{
|
2013-03-30 17:59:21 +01:00
|
|
|
struct timespec ts;
|
|
|
|
|
|
|
|
ts.tv_sec = tp->tv_sec;
|
|
|
|
ts.tv_nsec = tp->tv_usec * 1000;
|
2011-02-17 18:11:09 +01:00
|
|
|
|
|
|
|
/* Ignore time zones */
|
2013-03-30 17:59:21 +01:00
|
|
|
return clock_settime(CLOCK_REALTIME, &ts);
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|
2013-01-07 20:10:08 +01:00
|
|
|
|
2013-01-18 00:06:11 +01:00
|
|
|
#if defined(__minix) && defined(__weak_alias)
|
2013-01-07 20:10:08 +01:00
|
|
|
__weak_alias(settimeofday, __settimeofday50)
|
|
|
|
#endif
|