blob: cb7e8040c4db84b54ea751cd020468b1aeb89398 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* vi: set sw=4 ts=4: */
2/*
3 * stime() for uClibc
4 *
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6 *
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8 */
9
10#include <sys/syscall.h>
11#include <time.h>
12#include <sys/time.h>
13
14#ifdef __USE_SVID
15#ifdef __NR_stime
16_syscall1(int, stime, const time_t *, t)
17#else
18
19int stime(const time_t * when)
20{
21 struct timeval tv;
22
23 if (when == NULL) {
24 __set_errno(EINVAL);
25 return -1;
26 }
27 tv.tv_sec = *when;
28 tv.tv_usec = 0;
29 return settimeofday(&tv, (struct timezone *) 0);
30}
31#endif
32#endif