ast_comparator/test/student_data/handout/shlab-handout/cases/reference_3_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)
{
    int pid = 0;
    struct job_t *job;
    int jid = 0;
    if((pid = fgpid(jobs)) != 0) {
        job = getjobpid(jobs,pid);
        jid = job->jid;
        kill(-pid,SIGINT);
        printf("Job [%d] (%d) terminated by signal %d\n",jid,pid,SIGINT);
    }
    return;
}
void sigint_handler ( int sig ) { int pid = 0 ; struct job_t * job ; int jid = 0 ; if ( ( pid = fgpid ( jobs ) ) != 0 ) { job = getjobpid ( jobs , pid ) ; jid = job -> jid ; kill ( - pid , SIGINT ) ; 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 .