sigaction structure + compilation prob

For a program I am writing, Im using sigaction to catch and handle signals (i.e. SIGINT, SIGSTP) in my program.

Ive declared and initalised the corresponding sigaction structure as follows


struct sigaction event;
event.sa_handler = MySigHandler; /* The signal handling function */
event.sa_flags=0;
sigemptyset(&event.sa_mask);
sigaction(SIGINT,&event,NULL);

However when I compile the program, I get an error message saying storage size of 'event' (the sigaction structure) is unknown.

Im lost to know what the message means and how I could have possibly created the error. Help would be highly appreciated

cheers

I am not comfortable with signal progrraming. But looking at the error, i think you missed to include the header file, where sigaction structure is declared. Did you include signal.h in your code ?

Sorry, I should have pointed out in my previous post the code I wrote down was only a portion of the entire program. Also to answer ur original question, yes I did include signal.h