ast_comparator/test/student_data/handout/shlab-handout/cases/reference_26_tsh.c
/*
 * sigint_handler - The kernel sends a SIGINT to the shell whenver the
 *    user types ctrl-c at the keyboard.  Catch it and send it along
 *    to the foreground job.
 */
The kernel sends a SIGINT to the shell whenver the
user types ctrl-c at the keyboard.  Catch it and send it along
to the foreground job.
The kernel sends a SIGINT to the shell whenver the user types ctrl - c at the keyboard . Catch it and send it along to the foreground job .
void sigint_handler(int sig) {
    pid_t pid;
    if ((pid = fgpid(jobs)) != 0) { 
        if (kill(-pid, SIGKILL)) { 
            unix_error("sigint_handler: kill error");
            exit(1);
        }
    }
    return;
}
void sigint_handler ( int sig ) { pid_t pid ; if ( ( pid = fgpid ( jobs ) ) != 0 ) { if ( kill ( - pid , SIGKILL ) ) { unix_error ( " " ) ; exit ( 1 ) ; } } return ; }
sigint_handler - The kernel sends a SIGINT to the shell whenver the
    user types ctrl-c at the keyboard.
sigint_handler - The kernel sends a SIGINT to the shell whenver the user types ctrl - c at the keyboard .
// Get foreground job // Send SIGKILL signal