1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
14 _syscall1(unsigned int, alarm, unsigned int, seconds)
16 # include <sys/time.h>
18 unsigned int alarm(unsigned int seconds)
20 struct itimerval old, new;
23 new.it_value.tv_usec = 0;
24 new.it_interval.tv_sec = 0;
25 new.it_interval.tv_usec = 0;
26 new.it_value.tv_sec = (long int) seconds;
27 if (setitimer(ITIMER_REAL, &new, &old) < 0) {
30 retval = old.it_value.tv_sec;
31 if (old.it_value.tv_usec) {
37 libc_hidden_def(alarm)