Hey all
we have a program that is supposed to fork to children, and each child calls a program which is supposed to send 100 signals to the other child process
now we have these programs sending signals, and we catch teh signals, and in the end we are supposed to time how long this takes
now when our program sends 100 signals, it kills each process and nothing happens afterwards, there is supposed to be a way to block and handle these signals as they come in, they way i get it is its sending lots of signals and i guess we are not waiting before it is received before the next one is sent out (if that makes any sense)
basically, we read about masks, and sigsuspend, and tried some stuff but no luck
Code:
sigset_t mask, oldmask;
...
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);
sigprocmask (SIG_BLOCK, &mask, &oldmask);
while(***what goes here??***)
{
sigsuspend(&oldmask);
}
sigprocmask (SIG_UNBLOCK, &mask, NULL);
now i got thsi example from elsewhere in this forum, in the while loop condition before the sig suspend, it said (!usr_interrupt), which they said waits for a user interrupt, how do we make a condition that says to wait for a signal interrupt, i think that may be our problem, any suggestions are appreciate, thanks!!!!