1 /* vi: set sw=4 ts=4: */
3 * settimeofday() for uClibc
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
13 # include <sys/time.h>
14 # ifdef __NR_settimeofday
15 _syscall2(int, settimeofday, const struct timeval *, tv,
16 const struct timezone *, tz)
17 # elif defined __USE_SVID && defined __NR_stime
22 int settimeofday(const struct timeval *tv, const struct timezone *tz)
31 if (tz != NULL || tv->tv_usec % 1000000 != 0) {
36 when = tv->tv_sec + (tv->tv_usec / 1000000);
40 # if defined __NR_settimeofday || (defined __USE_SVID && defined __NR_stime)
41 libc_hidden_def(settimeofday)