SYNOPSIS
#include <time.h>
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp);
DESCRIPTION
The
When TIMER_ABSTIME is set, rgtp points to an
absolute time and the
-
The time value clock specified by clock_id reaches rgtp.
-
The calling thread receive a signal that invokes a signal-catching function.
-
The process is terminated.
The
When TIMER_ABSTIME is not set, rgtp points to a
relative time interval and the
-
The time interval specified rgtp has passed on the clock specified by clock_id.
-
The calling thread receive a signal that invokes a signal-catching function.
When this function suspends a thread, the length of the suspension may exceed the requested time because the tp value is automatically rounded to an integer multiple of the sleep resolution or because of other system activity. When TIMER_ABSTIME is set, the suspension time lasts until rqtp is reached unless interrupted by a signal. When TIMER_ABSTIME is not set, the suspension time will not exceed rqtp unless interrupted by a signal.
When TIMER_ABSTIME is not set and a signal interrupts the calling thread, the time remaining in the specified time interval returned in the timespec structure pointed to by rmtp. However, if rmtp is null, the time remaining is not returned.
The
PARAMETERS
- clock_id
-
Indicates the clock to be used. On the NuTCRACKER Platform, only CLOCK_MONOTONIC and CLOCK_REALTIME may be used.
- flags
-
Contains the TIMER_ABSTIME flag which determines whether rqtp is an absolute or relative time value.
- rmtp
-
Points to a timespec structure where, when TIMER_ABSTIME is not set, the time remaining until the normal end of suspension is returned.
- rqtp
-
Points to a timespec structure containing a time value.
RETURN VALUES
When
Otherwise,
- EINTR
-
A signal has interrupted the
clock_nanosleep() function. - EINVAL
-
The rqtp value is invalid or clock_id does not indicate a known clock, or clock_id specifies the CPU-time clock of the calling process.
- ENOTSUP
-
The
clock_nanosleep() function is not supported for the specified clock_id. clock.
CONFORMANCE
UNIX 03.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
On the NuTCRACKER Platform,
The flag TIMER_RESUME can be used to configure
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
_NutConf() ,clock_getres() ,nanosleep() ,pthread_cond_timedwait() ,sleep()
PTC MKS Toolkit 10.5 Documentation Build 40.