ast_comparator/test/student_data/handout/shlab-handout/cases/reference_12_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 = fgpid(jobs);
    int jid = pid2jid(pid);
    if (pid != 0) 
    {
        kill(-pid, SIGINT); 
        if (sig < 0)
        {
            printf("Job [%d] (%d) terminated by signal %d\n", jid, pid, (-sig));
            deletejob(jobs, pid);   
        }
    }
    return;
}
void sigint_handler ( int sig ) { int pid = fgpid ( jobs ) ; int jid = pid2jid ( pid ) ; if ( pid != 0 ) { kill ( - pid , SIGINT ) ; if ( sig < 0 ) { printf ( " \n " , jid , pid , ( - sig ) ) ; deletejob ( jobs , pid ) ; } } 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 .
// send fg job related process group signal // send signal for interrupt  // delete jobs