ast_comparator/test/student_data/handout/shlab-handout/cases/reference_10_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;
    int jid;
    pid = fgpid(jobs);
    jid = pid2jid(pid); 
    pause_flag = 1;
    if (kill(-pid, SIGINT) < 0) {
        fprintf(stdout, "kill error");
        return;
    }
    printf("JID [%d] (%d) terminated by signal %d\n", jid, pid, SIGINT);
    return;
}
void sigint_handler ( int sig ) { pid_t pid ; int jid ; pid = fgpid ( jobs ) ; jid = pid2jid ( pid ) ; pause_flag = 1 ; if ( kill ( - pid , SIGINT ) < 0 ) { fprintf ( stdout , " " ) ; return ; } printf ( " \n " , jid , pid , SIGINT ) ; 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 .