当前位置: 技术问答>linux和unix
如何捕捉多次的SIGALRM信号
来源: 互联网 发布时间:2014-12-13
本文导语: #include #include #include sig(int signal) { printf("nget a signal!n"); } main() { struct itimerval value,ovalue; int n; value.it_value.tv_sec=3; value.it_value.tv_usec=0; value.it_interval.tv_sec=3; value.it_interval.tv_usec=0; setitimer(ITIMER_REAL,&value,&ovalue...
#include
#include
#include
sig(int signal)
{
printf("nget a signal!n");
}
main()
{
struct itimerval value,ovalue;
int n;
value.it_value.tv_sec=3;
value.it_value.tv_usec=0;
value.it_interval.tv_sec=3;
value.it_interval.tv_usec=0;
setitimer(ITIMER_REAL,&value,&ovalue);
for(n=0;n
#include
#include
sig(int signal)
{
printf("nget a signal!n");
}
main()
{
struct itimerval value,ovalue;
int n;
value.it_value.tv_sec=3;
value.it_value.tv_usec=0;
value.it_interval.tv_sec=3;
value.it_interval.tv_usec=0;
setitimer(ITIMER_REAL,&value,&ovalue);
for(n=0;n