projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
rename aligned_alloc source file
[musl]
/
src
/
unistd
/
alarm.c
1
#include <unistd.h>
2
#include <sys/time.h>
3
#include "syscall.h"
4
5
unsigned alarm(unsigned seconds)
6
{
7
struct itimerval it = { .it_value.tv_sec = seconds }, old = { 0 };
8
setitimer(ITIMER_REAL, &it, &old);
9
return old.it_value.tv_sec + !!old.it_value.tv_usec;
10
}