ast_comparator/test/student_data/handout/shlab-handout/cases/reference_6_tsh.c
/* fgpid - Return PID of current foreground job, 0 if no such job */
Return PID of current foreground job, 0 if no such job
Return PID of current foreground job 0 if no such job
pid_t fgpid(struct job_t *jobs) {
    int i;
    for (i = 0; i < MAXJOBS; i++)
    if (jobs[i].state == FG)
        return jobs[i].pid;
    return 0;
}
pid_t fgpid ( struct job_t * jobs ) { int i ; for ( i = 0 ; i < MAXJOBS ; i ++ ) if ( jobs [ i ] . state == FG ) return jobs [ i ] . pid ; return 0 ; }
fgpid - Return PID of current foreground job, 0 if no such job
fgpid - Return PID of current foreground job 0 if no such job