Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 8
Suspend a thread until a timeout or signal occurs
#include <time.h>
int nanosleep( const struct timespec* rqtp,
struct timespec* rmtp );
- rqtp
- A pointer to a
timespec
structure that specifies the time interval for which you want to suspend
the thread.
- rmtp
- NULL, or a pointer to a timespec structure
where the function can store the amount of time remaining in the interval
(the requested time minus the time actually slept).
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The nanosleep() function causes the calling thread to be
suspended from execution until either:
- The time interval specified by the rqtp argument has elapsed
Or
- A signal is delivered to the thread, and the signal's action
is to invoke a signal-catching function or terminate the process.
- 0
- The requested time has elapsed.
- -1
- The nanosleep() function was interrupted by a signal
(errno
is set).
- EAGAIN
- All timers are in use. You'll have to wait for a process to release
one.
- EFAULT
- A fault occurred trying to access the buffers provided.
- EINTR
- The nanosleep() function was interrupted by a signal.
- EINVAL
- The number of nanoseconds specified by the tv_nsec member
of the timespec
structure pointed to by rqtp is less than zero or greater
than or equal to 1000 million.
POSIX 1003.1 TMR
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
delay,
errno,
clock_getres(),
clock_gettime(),
clock_settime(),
sleep(),
timer_create(),
timer_delete(),
timer_gettime(),
timer_settime(),
timespec,
usleep()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 196
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/n/nanosleep.html on line 196