G
Giuseppe
hello,
I have a small question, how to prevent EINTR error. I use semaphore to
access shared memmory, i also use a signal function to catch SIGINT....
and when i send a signal to a process sometimes i get "interrupted system
call".
........
........
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGUSR2);
sigaddset(&set, SIGTSTP);
loop
.......
.......
sigprocmask(SIG_SETMASK, set, NULL);
semP(); // my semaphore functions
.....
.......
semV();
sigprocmask(SIG_UNBLOCK, set, NULL);
I read that signals which are blocked are not dropped, so in my opinion
this code should be working. Thanks for any help
I have a small question, how to prevent EINTR error. I use semaphore to
access shared memmory, i also use a signal function to catch SIGINT....
and when i send a signal to a process sometimes i get "interrupted system
call".
........
........
sigemptyset(&set);
sigaddset(&set, SIGINT);
sigaddset(&set, SIGUSR2);
sigaddset(&set, SIGTSTP);
loop
.......
.......
sigprocmask(SIG_SETMASK, set, NULL);
semP(); // my semaphore functions
.....
.......
semV();
sigprocmask(SIG_UNBLOCK, set, NULL);
I read that signals which are blocked are not dropped, so in my opinion
this code should be working. Thanks for any help