musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/unistd/alarm.c 6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unistd/alarm.c b/src/unistd/alarm.c
index 2e3263ac..a5e0c822 100644
--- a/src/unistd/alarm.c
+++ b/src/unistd/alarm.c
@@ -4,7 +4,7 @@
unsigned alarm(unsigned seconds)
{
- struct itimerval it = { .it_value.tv_sec = seconds };
- __syscall(SYS_setitimer, ITIMER_REAL, &it, &it);
- return it.it_value.tv_sec + !!it.it_value.tv_usec;
+ struct itimerval it = { .it_value.tv_sec = seconds }, old = { 0 };
+ setitimer(ITIMER_REAL, &it, &old);
+ return old.it_value.tv_sec + !!old.it_value.tv_usec;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月26日 15:44:55 +0000

AltStyle によって変換されたページ (->オリジナル) /