projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
add legacy sys/ttydefaults.h header
[oweals/musl.git]
/
src
/
unistd
/
ualarm.c
1
#define _GNU_SOURCE
2
#include <unistd.h>
3
#include <sys/time.h>
4
5
unsigned ualarm(unsigned value, unsigned interval)
6
{
7
struct itimerval it = {
8
.it_interval.tv_usec = interval,
9
.it_value.tv_usec = value
10
};
11
setitimer(ITIMER_REAL, &it, &it);
12
return it.it_value.tv_sec*1000000 + it.it_value.tv_usec;
13
}