I need some help with msgrcv... I need to be able to receive messages like this:
while(1){
int status = msgrcv(qid, &msg, sizeof(msg.data), user_id,0 )
if(status < 0) { perror("something wrong..."); exit(1); }
}
And also somewhere on the code:
void stuff_to_do(int signal){
// ....
}
//...
signal(SIGQUIT, stuff_to_do);
But I get a Interrupted System Call, probably because the signal kills the msgrcv or something like that. How can I solve this? Should i fork() and do the msgrcv in one process and do the stuff on the other process? Or is there a better way? Thanks for the help!