ast_comparator/test/student_data/handout/shlab-handout/cases/reference_32_tsh.c
/*
#  * mask the indicated signal according to "how"
#  */
mask the indicated signal according to "how"
mask the indicated signal according to " how "
sigset_t mask_signal(int how, int sig) {
sigset_t signals, result;
if (sigemptyset(&signals) < 0)
unix_error("mask_signal: sigemptyset failed");
if (sigaddset(&signals, sig) < 0)
unix_error("mask_signal: sigaddset failed");
if (sigprocmask(how, &signals, &result) < 0)
unix_error("mask_signal: sigprocmask failed");
return result;
}
sigset_t mask_signal ( int how , int sig ) { sigset_t signals , result ; if ( sigemptyset ( & signals ) < 0 ) unix_error ( " " ) ; if ( sigaddset ( & signals , sig ) < 0 ) unix_error ( " " ) ; if ( sigprocmask ( how , & signals , & result ) < 0 ) unix_error ( " " ) ; return result ; }
mask the indicated signal according to "how"
mask the indicated signal according to " how "