ast_comparator/test/student_data/handout/shlab-handout/cases/32_tsh.c
/*
 * sigtstp_handler - The kernel sends a SIGTSTP to the shell whenever
 *     the user types ctrl-z at the keyboard. Catch it and suspend the
 *     foreground job by sending it a SIGTSTP.
 */
The kernel sends a SIGTSTP to the shell whenever
the user types ctrl-z at the keyboard. Catch it and suspend the
foreground job by sending it a SIGTSTP.
The kernel sends a SIGTSTP to the shell whenever the user types ctrl - z at the keyboard . Catch it and suspend the foreground job by sending it a SIGTSTP .
void sigtstp_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 sigstp_handler");
		return;
	}
  return;
}
void sigtstp_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 ; }
sigtstp_handler - The kernel sends a SIGTSTP to the shell whenever
     the user types ctrl-z at the keyboard.
sigtstp_handler - The kernel sends a SIGTSTP to the shell whenever the user types ctrl - z at the keyboard .