Logo_UPNA

Laboratorio de Telemática

Cuarto curso de Ingeniería de Telecomunicación

nanosleep(3R)           Realtime Library            nanosleep(3R)


NAME
     nanosleep - high resolution sleep

SYNOPSIS
     cc [ flag ... ] file ...  -lposix4 [ library ... ]

     #include 

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

     struct timespec {
          time_t        tv_sec; /* seconds */
          long          tv_nsec;/* and nanoseconds */
     };

MT-LEVEL
     MT-Safe

DESCRIPTION
     nanosleep() suspends the current thread from execution until
     either the time interval specified by rqtp has elapsed, or a
     signal is delivered to the calling thread and its action  is
     to  invoke  a  signal-catching  function or to terminate the
     thread.  The suspension time may be  longer  than  requested
     because  the argument value is rounded up to an integer mul-
     tiple of the sleep resolution or because of  the  scheduling
     of  other  activity  by  the system.  Except for the case of
     being interrupted by a signal, the suspension time will  not
     be  less than the time specified by rqtp, as measured by the
     system clock, CLOCK_REALTIME.

     nanosleep() will not block nor effect the action of any sig-
     nal.

RETURN VALUES
     If  nanosleep()  returns  because  the  requested  time  has
     elapsed,  it  returns 0. Otherwise, if it returns because it
     has been interrupted by a signal:

          it returns -1 and sets errno to indicate the  interrup-
          tion.

          If rmtp is non-NULL, the timespec structure  referenced
          by rmtp will be updated to contain the remaining amount
          of time between rqtp and the time actually slept.

     If any of the following error conditions occur,  nanosleep()
     returns -1 and sets errno to indicate the error condition.

ERRORS
     EINTR       nanosleep() was interrupted by a signal.



SunOS 5.5.1         Last change: 19 Aug 1993                    1


nanosleep(3R)           Realtime Library            nanosleep(3R)



     EINVAL      rqtp specified a nanosecond value less than zero
                 or greater than or equal to 1,000,000,000.

     ENOSYS      nanosleep() is not supported by this implementa-
                 tion.

SEE ALSO
     sleep(3C)


SunOS 5.5.1         Last change: 19 Aug 1993                    2