ast_comparator/test/student_data/handout/shlab-handout/cases/reference_3_tsh.c
/*
 * waitfg - Block until process pid is no longer the foreground process
 */
Block until process pid is no longer the foreground process
Block until process pid is no longer the foreground process
void waitfg(pid_t pid)
{
    int status;
    waitpid(pid,&status,WUNTRACED);
    if (!WIFSTOPPED(status))
        deletejob(jobs,pid);
    return;
}
void waitfg ( pid_t pid ) { int status ; waitpid ( pid , & status , WUNTRACED ) ; if ( ! WIFSTOPPED ( status ) ) deletejob ( jobs , pid ) ; return ; }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process