ast_comparator/test/student_data/handout/shlab-handout/cases/reference_5_tsh.c
/* tchelper - Set foreground process group ID to shell's PID if necessary */
Set foreground process group ID to shell's PID if necessary
Set foreground process group ID to shell ' s PID if necessary
void 
tchelper(pid_t pid) {
    if(pid == fgpid(job_list)){
        if(tcgetpgrp(STDIN_FILENO) != shell_pid) {
            tcsetpgrp(STDIN_FILENO, shell_pid);
        }
    }
    return;
}
void tchelper ( pid_t pid ) { if ( pid == fgpid ( job_list ) ) { if ( tcgetpgrp ( STDIN_FILENO ) != shell_pid ) { tcsetpgrp ( STDIN_FILENO , shell_pid ) ; } } return ; }
tchelper - Set foreground process group ID to shell's PID if necessary
tchelper - Set foreground process group ID to shell ' s PID if necessary