ast_comparator/test/student_data/handout/shlab-handout/cases/reference_12_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)
{
    while(pid == fgpid(jobs)) 
    {
        sleep(0);   
    }
}
void waitfg ( pid_t pid ) { while ( pid == fgpid ( jobs ) ) { sleep ( 0 ) ; } }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process
// it wait until process is out of foreground // here it take wait for the process is out of the foreground