ast_comparator/test/student_data/handout/shlab-handout/cases/reference_11_tsh.c
/*
 * block the SIGCHLD, SIGINT, SIGTSTP signal before fork child process
 */
block the SIGCHLD, SIGINT, SIGTSTP signal before fork child process
block the SIGCHLD SIGINT SIGTSTP signal before fork child process
void
block_sigs(sigset_t* newset, sigset_t* oldset)
{
    if(sigemptyset(newset)){
        unix_error("set is not empty");
    }
    if(sigaddset(newset, SIGCHLD) ||
       sigaddset(newset, SIGINT) ||
       sigaddset(newset, SIGTSTP)){
        unix_error("error in sigaddset");
    }
    if(sigprocmask(SIG_BLOCK, newset, oldset)){
        unix_error("error in sigprocmask");
    }
}
void block_sigs ( sigset_t * newset , sigset_t * oldset ) { if ( sigemptyset ( newset ) ) { unix_error ( " " ) ; } if ( sigaddset ( newset , SIGCHLD ) || sigaddset ( newset , SIGINT ) || sigaddset ( newset , SIGTSTP ) ) { unix_error ( " " ) ; } if ( sigprocmask ( SIG_BLOCK , newset , oldset ) ) { unix_error ( " " ) ; } }
block the SIGCHLD, SIGINT, SIGTSTP signal before fork child process
block the SIGCHLD SIGINT SIGTSTP signal before fork child process