Back to index

glibc  2.9
ualarm.c File Reference
#include <sys/time.h>
#include <unistd.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


useconds_t ualarm (useconds_t value, useconds_t interval)

Function Documentation

useconds_t ualarm ( useconds_t  value,
useconds_t  interval 

Definition at line 28 of file ualarm.c.

  struct itimerval timer, otimer;

  timer.it_value.tv_sec = 0;
  timer.it_value.tv_usec = value;
  timer.it_interval.tv_sec = 0;
  timer.it_interval.tv_usec = interval;

  if (__setitimer (ITIMER_REAL, &timer, &otimer) < 0)
    return -1;

  return (otimer.it_value.tv_sec * 1000000) + otimer.it_value.tv_usec;

Here is the call graph for this function: