waitproc
STATIC int waitproc(int, struct job *, int *);
pid = waitproc(flags & WBLOCK, job, &status);