ast_comparator/test/student_data/handout/shlab-handout/cases/63_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)
{
	if(verbose)
		printf("waitfg: Waiting for process (%d)\n", pid);
	struct job_t *job = getjobpid(jobs, pid);
	while(job->state == FG) pause();
	if(verbose)
		printf("waitfg: Process (%d) no longer the fg process\n", pid);
  return;
}
void waitfg ( pid_t pid ) { if ( verbose ) printf ( " \n " , pid ) ; struct job_t * job = getjobpid ( jobs , pid ) ; while ( job -> state == FG ) pause ( ) ; if ( verbose ) printf ( " \n " , pid ) ; return ; }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process
/* Simply pauses until a signal is recieved and then checks whether the
	 * process with the pid it's waiting for left the foreground or not
	 */