|
@@ -1,7 +1,10 @@
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
|
|
+#include <sys/time.h>
|
|
#include "syscall.h"
|
|
#include "syscall.h"
|
|
|
|
|
|
unsigned alarm(unsigned seconds)
|
|
unsigned alarm(unsigned seconds)
|
|
{
|
|
{
|
|
- return syscall(SYS_alarm, 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;
|
|
}
|
|
}
|