5
/* $Header: /tmp/hpctools/ga/tcgmsg/ipcv4.0/waitall.c,v 1.3 1995-02-24 02:18:05 d3h325 Exp $ */
8
#if defined(SUN) || defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || \
9
defined(AIX) || defined(NEXT) || defined(DECOSF) || defined(LINUX)
16
Wait for all children to finish and return appropriate status
21
int status, pid, child, stat=0, lo, hi;
23
#if defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || defined(NEXT)
27
for (child=0; child<nchild; child++) {
28
#if defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || defined(NEXT)
30
status = ustatus.w_status;
35
(void) printf("Child finished pid=%d, status=0x%x\n",pid, status);
36
(void) fflush(stdout);
39
(void) fprintf(stderr,"WaitAll: No children or error in wait?\n");
44
(void) fprintf(stderr, "WaitAll: Child (%d) finished, status=0x%x ",
48
hi = (status >> 8) & 0xff;
51
(void) fprintf(stderr, "(stopped by signal %d).\n", hi);
52
else if ( (lo != 0) && (lo & 0200) )
53
(void) fprintf(stderr, "(killed by signal %d, dumped core).\n",
56
(void) fprintf(stderr, "(killed by signal %d).\n",lo);
58
(void) fprintf(stderr, "(exited with code %d).\n",hi);
60
(void) fflush(stderr);