repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
loongarch64: add new syscall numbers
[musl.git]
/
src
/
unistd
/
alarm.c
blob
a5e0c822a05559ffaa2023ab8b6fca3d20f1af63
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
}