Back to index

glibc  2.9
sleep.c File Reference
#include <signal.h>
#include <time.h>
#include <unistd.h>
#include <mach.h>

Go to the source code of this file.


unsigned int __sleep (unsigned int seconds)

Function Documentation

unsigned int __sleep ( unsigned int  seconds)

Definition at line 30 of file sleep.c.

  time_t before, after;
  mach_port_t recv;

  recv = __mach_reply_port ();

  before = time ((time_t *) NULL);
                   0, 0, recv, seconds * 1000, MACH_PORT_NULL);
  after = time ((time_t *) NULL);
  __mach_port_destroy (__mach_task_self (), recv);

  return seconds - (after - before);

Here is the call graph for this function: