Upgraded GRUB2 to 2.00 release.
[AROS.git] / compiler / clib / nanosleep.c
blob4108a6519bb8562e2aaed99a55cd45c097011071
1 /*
2 Copyright © 2008-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2008 function nanosleep().
6 */
8 #include <unistd.h>
10 /*****************************************************************************
12 NAME */
13 #include <time.h>
15 int nanosleep (
17 /* SYNOPSIS */
18 const struct timespec * req, struct timespec *rem)
20 /* FUNCTION
21 Suspends program execution for a given number of nanoseconds.
23 INPUTS
24 req - time to wait
25 rem - remaining time, if nanosleep was interrupted by a signal
27 RESULT
28 0 on success, -1 on error
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
39 sorry, this function just calls usleep()
41 ******************************************************************************/
43 useconds_t usec = req->tv_sec * 10000000 + req->tv_nsec / 1000;
44 return usleep(usec);
45 } /* nanosleep() */