Q about signals (SIG{STP, STOP, TTIN, TTOU}).

Mumit Khan mumit at garfield.cs.wisc.edu
Sun Sep 9 04:31:53 AEST 1990


Hi:
Is there any way (under BSD derived U*x) to find the pid of the child
processes that are stopped due to SIGTTIN, SIGTTOU, SIGSTP and
SIGSTOP?

Here's the problem:
I have an X-based environment where a user configures the applications to
be run, and then uses a menu-button to run it. I'm installing a handler 
for SIGCHLD for each child that I'm running and then going off to do my
thing. Whenever a child exits, my handler is called and everything is
great (since I get the pid from wait/wait3). But, the handler is also
called in case any of the child processes receive the 4 signals above and
in this case wait3() returns 0 (not the pid). This is usually the case
when a child wants to read from stdin (bad!). My policy is to kill such a
child and let the user know, since the applications to be wrapped in this
environment are not supposed to read standard input. But I CAN'T seem to 
find the pid, and of course, can't kill the damn thing.

OS: Ultrix 3.1
CPU: DecStation 3100

Any ideas??? Am I missing something very obvious??? Help appreciated.

Mumit -- khan at xraylith.wisc.edu



More information about the Comp.unix.questions mailing list