ast_comparator/test/student_data/handout/shlab-handout/cases/prev_14_tsh.c
/*
 * waitfg - Block until process pid is no longer the foreground process
 *
 * this waits for the foreground job to finish.
 * it will return after it finishes
 */
Block until process pid is no longer the foreground process
this waits for the foreground job to finish.
it will return after it finishes
Block until process pid is no longer the foreground process this waits for the foreground job to finish . it will return after it finishes
void waitfg(pid_t pid)
{ 
  struct job_t *job;
  job = getjobpid(jobs, pid);
  while(job->state == FG) { 
    sleep(1); 
  }
  return;
}
void waitfg ( pid_t pid ) { struct job_t * job ; job = getjobpid ( jobs , pid ) ; while ( job -> state == FG ) { sleep ( 1 ) ; } return ; }
waitfg - Block until process pid is no longer the foreground process
 this waits for the foreground job to finish.
waitfg - Block until process pid is no longer the foreground process this waits for the foreground job to finish .
//TODO4 // if the job is in the foreground // wait for another second.