ast_comparator/test/student_data/handout/shlab-handout/cases/prev_13_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 = fgpid(jobs); 
	if(pid != 0){ 	
		if(kill(-pid, SIGINT) < 0){ 
			if(errno != ESRCH) 
				unix_error("kill error");
		}
	}
  return;
}
void sigint_handler ( int sig ) { pid_t pid = fgpid ( jobs ) ; if ( pid != 0 ) { if ( kill ( - pid , SIGINT ) < 0 ) { if ( errno != ESRCH ) unix_error ( " " ) ; } } 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 SIGINT to that foreground job */ /* fgpid(jobs) return positive value only 
									 when foreground job exists. else it returns 0. */ /* reference says -pid required to send SIGINT 
													 to all process in foreground process group. */ /* Here, ESRCH just means that pid or process group doesn't exist.
														Not an error of kill itself. */