Clocks and Timers [POSIX Section 14]

Functions Implemented

int clock_settime( clockid_t clock_id,
const struct timespec *tp); 
int clock_gettime( clockid_t clock_id, struct timespec *tp); 
int clock_getres( clockid_t clock_id, struct timespec *tp); 
int timer_create( clockid_t clock_id, struct sigevent *evp,
	          timer_t *timer_id);
int timer_delete( timer_t timer_id ); 
int timer_settime( timer_t timerid, int flags,
	           const struct itimerspec *value,
	           struct itimerspec *ovalue ); 
int timer_gettime( timer_t timerid, struct itimerspec *value ); 
int timer_getoverrun( timer_t timerid ); 
int nanosleep( const struct timespec *rqtp, struct timespec *rmtp);
int gettimeofday(struct timeval *tv, struct timezone* tz);


  • Currently timer_getoverrun() only reports timer notifications that are delayed in the timer subsystem. If they are delayed in the signal subsystem, due to signal masks for example, this is not counted as an overrun.

  • The option CYGPKG_POSIX_TIMERS allows the timer support to be enabled or disabled, and causes _POSIX_TIMERS to be defined appropriately. This will cause other parts of the POSIX system to have limited functionality.

Documentation license for this page: Open Publication License