minix3/lib/libc/sys/settimeofday.c

22 lines
420 B
C
Raw Permalink Normal View History

2020-02-21 00:59:27 +05:30
#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)
{
struct timespec ts;
ts.tv_sec = tp->tv_sec;
ts.tv_nsec = tp->tv_usec * 1000;
/* Ignore time zones */
return clock_settime(CLOCK_REALTIME, &ts);
}
#if defined(__minix) && defined(__weak_alias)
__weak_alias(settimeofday, __settimeofday50)
#endif