make ualarm actually work (obsolete function removed from SUS)
This commit is contained in:
parent
e898a79053
commit
3910e93340
1 changed files with 9 additions and 4 deletions
|
|
@ -1,8 +1,13 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "syscall.h"
|
#include <sys/time.h>
|
||||||
|
|
||||||
/* FIXME: ?? */
|
unsigned ualarm(unsigned value, unsigned interval)
|
||||||
unsigned ualarm(unsigned useconds, unsigned interval)
|
|
||||||
{
|
{
|
||||||
return -1;
|
struct itimerval it = {
|
||||||
|
.it_interval.tv_usec = interval,
|
||||||
|
.it_value.tv_usec = value
|
||||||
|
};
|
||||||
|
setitimer(ITIMER_REAL, &it, &it);
|
||||||
|
return it.it_value.tv_sec*1000000 + it.it_value.tv_usec;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue