tag:blogger.com,1999:blog-8525919027680721883.post8352102882888476711..comments2024-03-29T09:37:16.378+05:30Comments on ccplusplus.com: sigtstp handlerSaurabh Guptahttp://www.blogger.com/profile/00311810578585599874noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-8525919027680721883.post-33790088231013950312015-01-15T20:19:53.142+05:302015-01-15T20:19:53.142+05:30Why not just send ourself SIGSTOP:
kill(getp...Why not just send ourself SIGSTOP:<br /><br /> kill(getpid(), SIGSTOP);<br /><br />Instead of all this:<br /><br /> sigemptyset(&mask); <br /> sigaddset(&mask, SIGTSTP); <br /> sigprocmask(SIG_UNBLOCK, &mask, NULL); <br /> signal(SIGTSTP, SIG_DFL); /* reset disposition to default */ <br /> kill(getpid(), SIGTSTP); /* and send the signal to ourself */ <br /> /* <br /> * we won't return from the kill until we're continued <br /> */ <br /> signal(SIGTSTP, sig_tstp); /* reestablish signal handler */ <br />Anonymousnoreply@blogger.com