1 /*
2  * nanosleep() for uClibc
3  *
4  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5  *
6  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7  */
8 
9 #include <sys/syscall.h>
10 #include <time.h>
11 #include <cancel.h>
12 
13 
_NC(nanosleep)14 int _NC(nanosleep)(const struct timespec *req, struct timespec *rem)
15 {
16 	int __ret = clock_nanosleep(CLOCK_REALTIME, 0, req, rem);
17 
18 	if (__ret != 0) {
19 		__set_errno(__ret);
20 		return -1;
21 	}
22 
23 	return __ret;
24 };
25 
26 CANCELLABLE_SYSCALL(int, nanosleep,
27 		    (const struct timespec *req, struct timespec *rem),
28 		    (req, rem))
29 
30 lt_libc_hidden(nanosleep)
31