projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
a5e0c822a05559ffaa2023ab8b6fca3d20f1af63
[musl]
/
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
}