Back to index

glibc  2.9
usleep.c File Reference
#include <time.h>
#include <unistd.h>

Go to the source code of this file.


int usleep (useconds_t useconds)

Function Documentation

int usleep ( useconds_t  useconds)

Definition at line 25 of file usleep.c.

  struct timespec ts = { .tv_sec = (long int) (useconds / 1000000),
                      .tv_nsec = (long int) (useconds % 1000000) * 1000ul };

  /* Note the usleep() is a cancellation point.  But since we call
     nanosleep() which itself is a cancellation point we do not have
     to do anything here.  */
  return __nanosleep (&ts, NULL);

Here is the call graph for this function: