ast_comparator/test/student_data/handout/shlab-handout/cases/53_tsh.c
/*
 * wait_fg_process - 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 wait_fg_process(pid_t pid)
{
	struct job_t *job = get_job_by_pid(jobs, pid);
	while (job->state == STATE_FOREGROUND)
	{
		if (pause() != -1)
			unix_error("pause() returned unexpected value");
	}
}
void wait_fg_process ( pid_t pid ) { struct job_t * job = get_job_by_pid ( jobs , pid ) ; while ( job -> state == STATE_FOREGROUND ) { if ( pause ( ) != -1 ) unix_error ( " " ) ; } }
wait_fg_process - Block until process pid is no longer the foreground process
wait_fg_process - Block until process pid is no longer the foreground process
/* If job is terminated, state would have been changed to undefined
	 * by delete_job function */