*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/nanosleep (2)              
Title
Content
Arch
Section
 

Contents


NANOSLEEP(2)							  NANOSLEEP(2)


NAME    [Toc]    [Back]

     nanosleep - high resolution sleep

C SYNOPSIS    [Toc]    [Back]

     #include <time.h>

     int nanosleep(const struct	timespec *rqtp,	struct timespec	*rmtp);

DESCRIPTION    [Toc]    [Back]

     The nanosleep system call causes the current thread to suspend until
     either the	time interval specified	by the rqtp argument has elapsed or a
     signal is delivered to the	calling	thread and its action is to invoke a
     signal-handling function or terminate the process.

     The suspension time will be rounded to a multiple of the underlying
     system-provided sleep resolution.	For processes that have	requested a
     timeout of	less then the base clock tick of 10 milliseconds, this
     resolution	is defined by the variable fasthz which	may be examined	or
     modified using systune(1M). Real-Time processes will use a	resolution
     equal to the processor cycle time.	 Otherwise, the	resolution is
     determined	by the length of a clock tick.	The length of a	clock tick is
     defined by	CLK_TCK	in the include file <limits.h>.

SEE ALSO    [Toc]    [Back]

      
      
     sleep(3), sginap(2), alarm(2), pause(2), schedctl(2), timers(5),
     realtime(5).

DIAGNOSTICS    [Toc]    [Back]

     If	the calling thread remains suspended for the requested time interval,
     nanosleep returns 0.  If, however,	the thread is interrupted prematurely
     by	a signal, it returns -1	and sets errno to indicate the interruption.
     If	the rmtp argument is non-NULL, the timespec structure referenced by it
     contains the amount of time remaining in the interval.

     If	any of the following conditions	occur, nanosleep returns -1 and	sets
     errno to indicate the error:

     [EFAULT]	    An argument	address	referenced invalid memory.

     [EINTR]	    nanosleep was interrupted by a signal.

     [EINVAL]	    The	rqtp argument specified	a nanosecond value less	than
		    zero or greater than
		     or	equal to 1000 million.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
sleep Linux Sleep for the specified number of seconds
wakeup NetBSD process context sleep and and wakeup
tsleep NetBSD process context sleep and and wakeup
ltsleep NetBSD process context sleep and and wakeup
sleep OpenBSD process context sleep and wakeup
wakeup OpenBSD process context sleep and wakeup
sleep NetBSD process context sleep and and wakeup
tsleep OpenBSD process context sleep and wakeup
sleep Tru64 General: Puts a calling process to sleep
sginap IRIX timed sleep and processor yield function
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service