A
apoorva.groups
I am using setitimer function to timeout of the processing that I
doing.
I wrote a small program and it seems to be working...
It works with the cgi for values less than 1024 but for values more
that that it does not work.
I tried to use alarm but again it is not timing out. I am not sure
whether the SIGALRM is getting masked. If that is the case How to
make
sure that SIGALRM is not masked.
main()
{
long int Timer_Sec = 1800;
struct itimerval rttimer;
signal(SIGALRM,handler);
rttimer.it_value.tv_sec = Timer_Sec;
rttimer.it_value.tv_usec = 0;
rttimer.it_interval.tv_sec = 10;
rttimer.it_interval.tv_usec = 0;
system("date");
setitimer (ITIMER_REAL, &rttimer, NULL);
// alarm(Timer_Sec+120);
for(;;
}
void handler(int sig)
{
static int i = 0;
i++;
system("date");
printf("signal handler for %d\n",sig);
exit(1);
}
doing.
I wrote a small program and it seems to be working...
It works with the cgi for values less than 1024 but for values more
that that it does not work.
I tried to use alarm but again it is not timing out. I am not sure
whether the SIGALRM is getting masked. If that is the case How to
make
sure that SIGALRM is not masked.
main()
{
long int Timer_Sec = 1800;
struct itimerval rttimer;
signal(SIGALRM,handler);
rttimer.it_value.tv_sec = Timer_Sec;
rttimer.it_value.tv_usec = 0;
rttimer.it_interval.tv_sec = 10;
rttimer.it_interval.tv_usec = 0;
system("date");
setitimer (ITIMER_REAL, &rttimer, NULL);
// alarm(Timer_Sec+120);
for(;;
}
void handler(int sig)
{
static int i = 0;
i++;
system("date");
printf("signal handler for %d\n",sig);
exit(1);
}