diff options
Diffstat (limited to 'klibc/klibc/alarm.c')
-rw-r--r-- | klibc/klibc/alarm.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/klibc/klibc/alarm.c b/klibc/klibc/alarm.c deleted file mode 100644 index 40c0969432..0000000000 --- a/klibc/klibc/alarm.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * alarm.c - */ - -#include <sys/time.h> -#include <sys/syscall.h> - -#ifndef __NR_alarm - -/* Emulate alarm() via setitimer() */ - -unsigned int alarm(unsigned int seconds) -{ - struct itimerval iv; - - iv.it_interval.tv_sec = iv.it_interval.tv_usec = 0; - iv.it_value.tv_sec = seconds; - iv.it_value.tv_usec = 0; - - setitimer(ITIMER_REAL, &iv, &iv); - - return iv.it_value.tv_sec + (iv.it_value.tv_usec ? 1 : 0); -} - -#endif |