version 1.6, 1997/12/16 22:15:36 |
version 1.7, 1998/06/26 21:20:58 |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
|
#if 0 |
static char RCSid[] = |
static char RCSid[] = |
|
"$From: child.c,v 6.28 1996/02/22 19:30:09 mcooper Exp $"; |
|
#else |
|
static char RCSid[] = |
"$OpenBSD$"; |
"$OpenBSD$"; |
|
#endif |
|
|
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85"; |
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85"; |
|
|
|
|
|
|
sigemptyset(&set); |
sigemptyset(&set); |
sigaddset(&set, SIGCHLD); |
sigaddset(&set, SIGCHLD); |
sigprocmask(SIG_BLOCK, &set, (sigset_t *)NULL); |
sigprocmask(SIG_BLOCK, &set, NULL); |
#else /* !POSIX_SIGNALS */ |
#else /* !POSIX_SIGNALS */ |
int oldmask; |
int oldmask; |
|
|
|
|
childlist = pc->c_next; |
childlist = pc->c_next; |
|
|
#if defined(POSIX_SIGNALS) |
#if defined(POSIX_SIGNALS) |
sigprocmask(SIG_UNBLOCK, &set, (sigset_t *)NULL); |
sigprocmask(SIG_UNBLOCK, &set, NULL); |
#else |
#else |
sigsetmask(oldmask); |
sigsetmask(oldmask); |
#endif /* POSIX_SIGNALS */ |
#endif /* POSIX_SIGNALS */ |
|
|
register CHILD *pc; |
register CHILD *pc; |
fd_set *rchildfdsp = NULL; |
fd_set *rchildfdsp = NULL; |
int rchildfdsn = 0; |
int rchildfdsn = 0; |
int bytes; |
size_t bytes; |
|
|
debugmsg(DM_CALL, "waitup() start\n"); |
debugmsg(DM_CALL, "waitup() start\n"); |
|
|
|
|
debugmsg(DM_MISC, "waitup() Call select(), activechildren=%d\n", |
debugmsg(DM_MISC, "waitup() Call select(), activechildren=%d\n", |
activechildren); |
activechildren); |
|
|
count = select(rchildfdsn+1, (SELECT_FD_TYPE *) rchildfdsp, |
count = select(FD_SETSIZE, (SELECT_FD_TYPE *) rchildfdsp, |
(SELECT_FD_TYPE *) NULL, (SELECT_FD_TYPE *) NULL, |
NULL, NULL, NULL); |
(struct timeval *) NULL); |
|
|
|
debugmsg(DM_MISC, "waitup() select returned %d activechildren = %d\n", |
debugmsg(DM_MISC, "waitup() select returned %d activechildren = %d\n", |
count, activechildren); |
count, activechildren); |
|
|
readchild(pc); |
readchild(pc); |
--count; |
--count; |
} |
} |
|
free(rchildfdsp); |
|
|
#else /* !defined(HAVE_SELECT) */ |
#else /* !defined(HAVE_SELECT) */ |
|
|
|
|
*/ |
*/ |
debugmsg(DM_CALL, "waitup() start\n"); |
debugmsg(DM_CALL, "waitup() start\n"); |
|
|
if (waitproc((int *) NULL, TRUE) > 0) |
if (waitproc(NULL, TRUE) > 0) |
--activechildren; |
--activechildren; |
|
|
#endif /* defined(HAVE_SELECT) */ |
#endif /* defined(HAVE_SELECT) */ |
debugmsg(DM_CALL, "waitup() end\n"); |
debugmsg(DM_CALL, "waitup() end\n"); |
free(rchildfdsp); |
|
} |
} |
|
|
/* |
/* |