ast_comparator/test/student_data/handout/shlab-handout/cases/reference_8_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)
{ 
    struct job_t *p = getjobpid(jobs, pid);
    while(p->state == FG){
        sleep(1);
    }
    return;
}
void waitfg ( pid_t pid ) { struct job_t * p = getjobpid ( jobs , pid ) ; while ( p -> state == FG ) { sleep ( 1 ) ; } return ; }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process
//    waitpid(pid,NULL,0);    /*this is wrong answer ,see the num5 hints*/