ast_comparator/test/student_data/handout/shlab-handout/cases/51_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 tstppid = fgpid(jobs);
  if(tstppid) {
    if(kill(-tstppid, sig)<0) 
      unix_error("SIGTSTP_HANDLER ERROR");
  }
  return;
}
void sigtstp_handler ( int sig ) { pid_t tstppid = fgpid ( jobs ) ; if ( tstppid ) { if ( kill ( - tstppid , sig ) < 0 ) unix_error ( " " ) ; } 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 .
// send SIGTSTP signal to the process group and check if there was an error