c - Weird behaviour of sigwait -
i using sigwait block thread signals. these signals have been added in sigs set. per doc sigwait supposed wait signals passed set in argument , not supposed change th signal mask of thread.. reason dont know, changing signal mask of thread. blocking signals other ones in sigs. dont wish happen. can me same. thanx in advance
the code snippet:
sigset_t sigs; int sig_recvd; sigset_t old_mask; sigemptyset(&sigs); sigaddset(&sigs, sigusr1); sigaddset(&sigs, sigterm); sigaddset(&sigs, sighup); sigaddset(&sigs, sigint); sigaddset(&sigs, sigpipe); sigaddset(&sigs, sigchld); sigprocmask(sig_block, &sigs, &old_mask); { sigwait(&sigs, &sig_recvd); //switch signal handling } while(1);
sigblk before sigwait: 0000000080014203
sigblk during sigwait: fffffffefffabcfc
i dont wrong sigwait function when did same sigwaitinfo, things worked out me. couldnt figure out made later work, problem solved. know if there differences in implementation of the two
why not using pthread_sigmask() instead of sigprocmask()
Comments
Post a Comment