ast_comparator/test/student_data/handout/shlab-handout/cases/63_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)
{
	if(verbose)
		printf("sigint_handler: entering\n");
	pid_t pid;
	if ((pid = fgpid(jobs))){
		if(kill(-pid, SIGINT) < 0){
			unix_error("kill error");
		}
	}
	if(verbose)
		printf("sigint_handler: leaving\n");
  return;
}
void sigint_handler ( int sig ) { if ( verbose ) printf ( " \n " ) ; pid_t pid ; if ( ( pid = fgpid ( jobs ) ) ) { if ( kill ( - pid , SIGINT ) < 0 ) { unix_error ( " " ) ; } } if ( verbose ) printf ( " \n " ) ; 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 .
// First retrieves the pid of the FG process and then sends SIGINT to all processes in its group // Does nothing if no job is in the FG