|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 934 (0x3a6)
Types: TextFile
Names: »pidwait.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z«
└─⟦c75e36ecb⟧
└─⟦this⟧ »mh-6.7/sbr/pidwait.c«
/* pidwait.c - wait for child to exit */
#include "../h/mh.h"
#include <signal.h>
#include <stdio.h>
#ifdef BSD42
#include <sys/wait.h>
#endif BSD42
int pidwait (id, sigsok)
register int id,
sigsok;
{
register int pid;
TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
#ifndef BSD42
int status;
#else BSD42
union wait status;
#endif BSD42
if (sigsok == NOTOK) {
hstat = signal (SIGHUP, SIG_IGN);
istat = signal (SIGINT, SIG_IGN);
qstat = signal (SIGQUIT, SIG_IGN);
tstat = signal (SIGTERM, SIG_IGN);
}
while ((pid = wait (&status)) != NOTOK && pid != id)
continue;
if (sigsok == NOTOK) {
(void) signal (SIGHUP, hstat);
(void) signal (SIGINT, istat);
(void) signal (SIGQUIT, qstat);
(void) signal (SIGTERM, tstat);
}
#ifndef BSD42
return (pid == NOTOK ? NOTOK : status);
#else BSD42
return (pid == NOTOK ? NOTOK : status.w_status);
#endif BSD42
}