Becoming parent ...

Doug Gwyn gwyn at smoke.brl.mil
Sat Nov 3 21:31:49 AEST 1990


In article <24928 at adm.BRL.MIL> MANNS%DBNPIB5.BITNET at cunyvm.cuny.edu (Jochen Manns, PI der Uni Bonn, 732738/3611) writes:
>        - is it possible for a process to become a processes parent?

I assume you mean, when the process did not start out as the other process's
parent.  The answer is, it is not supposed to happen, except for process # 1,
the "init" process, which inherits as children all processes whose original
parents terminate before they do.

>So how can I attach to those processes again.

You cannot, at least not through any means I could recommend.

>... why aren't they killed when the job manager is killed ...?

Why should they be?

UNIX allows signals to be sent to individual processes or to entire
"process groups".  Unless something is specifically attempting to signal
a process group, it will affect only one process.  If the signal is self-
generated, as for abnormal termination, only the process that generates
the signal receives it.

>        - is there a way to access (argc,argv) from anywhere in a program?

The only portable method is for the main() function to store them in some
global variables.  Some versions of UNIX do have "secret" global variables
that are set up like that by the run-time start-up module, but you cannot
rely on it across all environments.



More information about the Comp.unix.questions mailing list