提交 3910e933 编写于 作者: R Rich Felker

make ualarm actually work (obsolete function removed from SUS)

上级 e898a790
#define _GNU_SOURCE
#include <unistd.h> #include <unistd.h>
#include "syscall.h" #include <sys/time.h>
/* FIXME: ?? */ unsigned ualarm(unsigned value, unsigned interval)
unsigned ualarm(unsigned useconds, unsigned interval)
{ {
return -1; struct itimerval it = {
.it_interval.tv_usec = interval,
.it_value.tv_usec = value
};
setitimer(ITIMER_REAL, &it, &it);
return it.it_value.tv_sec*1000000 + it.it_value.tv_usec;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册