Hi I have a program that requires a child process to modify a link list which the parent process keeps track of. Basically in the parent process I have a signal handler such as ..
struct sigaction sa;
sa.sa_handler = someFunction;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
if(sigaction(SIGUSR1, &sa, NULL) == -1){
printf("We have a problem, sigaction is not working.\n");
perror("\n");
exit(1);
}
Where the sa_handler is the modifying function. Then I have a global linked list that the parent process contains called struct conectionClient. The function that I use to modify the link list works, but when I call the signal handler as in ...
if(!fork){
raise(SIGUSR1);
exit(0);
}
And I fork(),fork(),... fork(), the parent process doesn't remember the previous forks like somethings been reset and the link list starts all over again. Is there something that I'm missing?
Thanks