summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/nanosleep.c
blob: 2b59fefefea078c349c98de52a2a73695c63ea79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * nanosleep() for uClibc
 *
 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */

#include <sys/syscall.h>
#include <time.h>
#include <cancel.h>


int _NC(nanosleep)(const struct timespec *req, struct timespec *rem)
{
	int __ret = clock_nanosleep(CLOCK_REALTIME, 0, req, rem);

	if (__ret != 0) {
		__set_errno(__ret);
		return -1;
	}

	return __ret;
};

CANCELLABLE_SYSCALL(int, nanosleep,
		    (const struct timespec *req, struct timespec *rem),
		    (req, rem))

lt_libc_hidden(nanosleep)