/* $Header: /home/harrison/c/tcgmsg/ipcv4.0/RCS/waitall.c,v 1.1 91/12/06 17:27:54 harrison Exp Locker: harrison $ */ #include #if defined(SUN) || defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || \ defined(AIX) || defined(NEXT) #include #endif int WaitAll(nchild) long nchild; /* Wait for all children to finish and return appropriate status 0 = OK 1 = bad news */ { int status, pid, child, stat=0, lo, hi; #if defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || defined(NEXT) union wait ustatus; #endif for (child=0; child> 8) & 0xff; if ( lo == 0177 ) (void) fprintf(stderr, "(stopped by signal %d).\n", hi); else if ( (lo != 0) && (lo & 0200) ) (void) fprintf(stderr, "(killed by signal %d, dumped core).\n", lo & 0100); else if ( lo != 0 ) (void) fprintf(stderr, "(killed by signal %d).\n",lo); else (void) fprintf(stderr, "(exited with code %d).\n",hi); (void) fflush(stderr); stat = 1; } } return stat; }