clock_nanosleep   Début   Suivant   Sommaire   Préc.page.lue   Accueil
Section: Linux Programmer's Guide (2)
Updated: 2004-March-12
Sommaire  



NAME   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
clock_nanosleep - Suspend execution of the currently running thread  



SYNOPSIS   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
long sys_clock_nanosleep (clockid_t which_clock, int flags, const struct timespec *rqtp, struct timespec *rmtp);
 



DESCRIPTION   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

clock_nanosleep suspends execution of the currently running thread until the time interval specified by rqtp is elapsed, or until the function is woken up by a signal. The rmtp is updated with the amount of time remaining in the time interval (requested minus sleep time) if non-null. If null, the rmtp argument does not return any remaining time information.

The flags parameter specifies the type of behavior the call will take. So far, the only value defined for this parameter (defined in include/linux.time.h is TIMER_ABSTIME). This value causes the current thread to be suspended from execution in three ways:

1.
Until either the time value of the clock specified by clock_id reaches the absolute time specified by the rqtp argument.
2.
Until a signal is delivered to the calling thread and its action is to invoke a signal-catching function.
3.
Until the process is terminated.

The values that clockid_t currently supports for POSIX.1b timers (defined in include/linux/time.h) are:

CLOCK_REALTIME
Systemwide realtime clock.
CLOCK_MONOTONIC
Represents monotonic time. Cannot be set.
CLOCK_PROCESS_CPUTIME_ID
High resolution per-process timer.
CLOCK_THREAD_CPUTIME_ID
Thread-specific timer.
CLOCK_REALTIME_HR
High resolution version of CLOCK_REALTIME.
CLOCK_MONOTONIC_HR
High resolution version of CLOCK_MONOTONIC.
 



RETURN VALUE   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

clock_nanosleep returns 0 if the time specified by rqtp has elapsed; otherwise, it returns one of the errors listed in the "Errors" section.  




ERRORS   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
-EINVAL
An invalid which_clock value or an invalid rqtp was specified.
-EFAULT
The value was could not be copied to the rmtp or an invalid rqtp value was specified.
 



SEE ALSO   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil

clock_getres(2), clock_gettime(2), clock_settime(2)  




AUTHOR   Début   Précédent   Suivant   Sommaire   Préc.page.lue   Accueil
Niki Rahimi


 



Sommaire   Début   Suivant   Sommaire   Préc.page.lue   Accueil
NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO
AUTHOR

Ce document a été créé par man2html suivi de man2html.pl, le 17/10/2008 17:49:53, en utilisant les pages de 'man'.
 

Valid HTML 4.01 Transitional