2 * clock_gettime() for uClibc
4 * Copyright (C) 2003 by Justus Pendleton <uc@ryoohki.net>
5 * Copyright (C) 2005 by Peter Kjellerstedt <pkj@axis.com>
6 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
8 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 #include <sys/syscall.h>
14 #if defined(__UCLIBC_USE_TIME64__) && defined(__NR_clock_gettime64)
15 _syscall2_64(int, clock_gettime
, clockid_t
, clock_id
, struct timespec
*, tp
)
16 #elif defined(__NR_clock_gettime)
17 _syscall2(int, clock_gettime
, clockid_t
, clock_id
, struct timespec
*, tp
)
19 # include <sys/time.h>
21 int clock_gettime(clockid_t clock_id
, struct timespec
* tp
)
28 /* In Linux, gettimeofday fails only on bad parameter.
29 * We know that here parameter isn't bad.
31 gettimeofday(&tv
, NULL
);
32 TIMEVAL_TO_TIMESPEC(&tv
, tp
);