ast_comparator/test/student_data/handout/shlab-handout/cases/reference_28_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 fgid = fgpid(jobs);
  if (fgid > 0) {
    struct job_t *job = getjobpid(jobs, fgid);
    kill(-fgid, SIGTSTP);
    job->state = ST;
  }
}
void sigtstp_handler ( int sig ) { pid_t fgid = fgpid ( jobs ) ; if ( fgid > 0 ) { struct job_t * job = getjobpid ( jobs , fgid ) ; kill ( - fgid , SIGTSTP ) ; job -> state = ST ; } }
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 .
/* get the foreground job pid programming homework help and ssend the SIGTSTP to it. */ /* mark the job stopped */