ast_comparator/test/student_data/handout/shlab-handout/cases/2_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))) {
    pid_t jid = pid2jid(pid);
    kill(-pid, SIGINT);
    deletejob(jobs, pid);
    printf("Job [%d] (%d) terminated by signal %d\n", jid, pid, sig);
  }
}
void sigint_handler ( int sig ) { pid_t pid ; if ( ( pid = fgpid ( jobs ) ) ) { pid_t jid = pid2jid ( pid ) ; kill ( - pid , SIGINT ) ; deletejob ( jobs , pid ) ; printf ( " \n " , jid , pid , sig ) ; } }
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 signal to entire foreground process group */