ast_comparator/test/student_data/handout/shlab-handout/cases/reference_32_tsh.c
/* pid2jid - Map process ID to job ID */
Map process ID to job ID
Map process ID to job ID
int pid2jid(pid_t pid) {
int i;
if (pid < 1)
return 0;
for (i = 0; i < MAXJOBS; i++)
if (jobs->pid == pid) {
return jobs->jid;
}
return 0;
}
int pid2jid ( pid_t pid ) { int i ; if ( pid < 1 ) return 0 ; for ( i = 0 ; i < MAXJOBS ; i ++ ) if ( jobs -> pid == pid ) { return jobs -> jid ; } return 0 ; }
pid2jid - Map process ID to job ID
pid2jid - Map process ID to job ID