muimaster.library: introduce a hack to make sure up/down arrows always work
[AROS.git] / compiler / posixc / usleep.c
blob37c4b68162387c7dfe2b5e15ffcb2b7c80ef487f
1 /*
2 Copyright © 2008, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2001 function usleep()
6 Function is removed from POSIX.1-2008
7 */
9 #include <aros/debug.h>
11 #include <time.h>
13 /*****************************************************************************
15 NAME */
16 #include <unistd.h>
18 int usleep (
20 /* SYNOPSIS */
21 useconds_t usec)
23 /* FUNCTION
24 Suspends program execution for a given number of microseconds.
26 INPUTS
27 usec - number of microseconds to wait
29 RESULT
30 0 on success, -1 on error
32 NOTES
33 This function is not part of POSIX.1-2008 anymore. Don't use this
34 function. As an alternative nanosleep() can be used.
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 nanosleep()
43 INTERNALS
44 This function is part of libarosc.a and may be removed in the future.
46 ******************************************************************************/
48 struct timespec req;
50 req.tv_sec = usec/1000000;
51 req.tv_nsec = (usec % 1000000)*1000;
53 return nanosleep(&req, NULL);
54 } /* usleep() */