computer-system/CMU15-213/labs/LAB5_tshlab/tsh.c
void waitfg(pid_t pid) {
    // int status;
    // if(waitpid(pid, &status, WUNTRACED) < 0) {
    //     unix_error("waitfg: waitpid error");
    // }
    while(fgpid(jobs) == pid) {}
}
/* 
 * 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(fgpid(jobs) == pid) {}
}
void waitfg ( pid_t pid ) { while ( fgpid ( jobs ) == pid ) { } }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process
// int status; // if(waitpid(pid, &status, WUNTRACED) < 0) { //     unix_error("waitfg: waitpid error"); // }