ast_comparator/test/student_data/handout/shlab-handout/cases/32_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 fg_pid;
	if((fg_pid= fgpid(jobs)) <= 0 ){
		unix_error("no running foreground process");
		return;
	}
	if(kill(-fg_pid, sig) <0 ){
		unix_error("kill error in sigint_handler");
		return;
	}
	return;
}
void sigint_handler ( int sig ) { pid_t fg_pid ; if ( ( fg_pid = fgpid ( jobs ) ) <= 0 ) { unix_error ( " " ) ; return ; } if ( kill ( - fg_pid , sig ) < 0 ) { unix_error ( " " ) ; return ; } 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 .