Saturday, October 29, 2011

sigtstp handler



See Also 
POSIX Signal Tutorial and example codes

1 comment:

  1. Why not just send ourself SIGSTOP:

    kill(getpid(), SIGSTOP);

    Instead of all this:

    sigemptyset(&mask);
    sigaddset(&mask, SIGTSTP);
    sigprocmask(SIG_UNBLOCK, &mask, NULL);
    signal(SIGTSTP, SIG_DFL); /* reset disposition to default */
    kill(getpid(), SIGTSTP); /* and send the signal to ourself */
    /*
    * we won't return from the kill until we're continued
    */
    signal(SIGTSTP, sig_tstp); /* reestablish signal handler */

    ReplyDelete