Introduce time64 support.
[uclibc-ng.git] / libpthread / nptl / sysdeps / unix / sysv / linux / nanosleep.c
blob9c7230934e29a38f5b6958fb9e254f3cdc8df154
1 /*
2 * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
3 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
4 */
6 #include <time.h>
7 #include <cancel.h>
9 /* Pause execution for a number of nanoseconds. */
10 int
11 _NC(nanosleep) (const struct timespec *requested_time,
12 struct timespec *remaining)
14 int __ret = clock_nanosleep(CLOCK_REALTIME, 0, requested_time, remaining);
16 if (__ret != 0) {
17 __set_errno(__ret);
18 return -1;
21 return __ret;
24 CANCELLABLE_SYSCALL(int, nanosleep, (const struct timespec *requested_time,
25 struct timespec *remaining), (requested_time, remaining))
27 lt_libc_hidden(nanosleep)