Hi-
Is it possible to send arguments to the sigaction handler? Here is my code:
Code:
void TimerProc(int isg, siginfo_t *info, void *flag)
{
// I want to access variables from main here with out having to make them global. Is this possible?
timerExpired = true; // how do I pass timerExpired to the handler?
}
int main()
{
bool timerExpired = false;
struct sigaction sact;
struct itimerval value;
memset (&sact, 0, sizeof(sact));
sact.sa_sigaction = &TimerProc; // how do I pass timerExpired to the handler?
sigaction (SIGVTALRM, &sact, NULL);
value.it_interval.tv_sec = 0;
value.it_interval.tv_usec = 15000;
value.it_value.tv_sec = 0;
value.it_value.tv_usec = 15000;
result = setitimer( ITIMER_VIRTUAL, &value, NULL );
}