Re: How to make A be the child process of B?

From: Artie Gold (artiegold_at_austin.rr.com)
Date: 08/28/03


Date: Thu, 28 Aug 2003 04:46:04 GMT

K.S.Liang wrote:
> Hi there,
>
> fork() can create the child process, but both the parent and child
> processes are from the same executable binary.

Well yes. Initially at least.

To run a different program, after you fork(), you call one of the
exec*() family of functions to overlay the process with a different
executable.

That's the way all processes (with the exception of `init') are created.

> Is there any way to
> make program A be the child process of process B? Or how can I make
> process A be the child process of process B at runtime if I have both
> process IDs?

Erm, no.

HTH,
--ag

-- 
Artie Gold -- Austin, Texas


Relevant Pages

  • Re: forking in c
    ... each child process should have a child process of their own. ... > meanwhile the parent process will have a childpid greater then 0 and it will ... Outside of failures in fork(), the parent /is/ creating new child processes ... continues executing from the first fork ...
    (comp.unix.programmer)
  • Re: timing a fork
    ... if ($kid) { ... this is within modperl/mason and I would like the parent process to be completely detached from the child and not care when the child completes... ... imperfect emulation of fork on a Windows platform. ... That is why I want the child process to be detached. ...
    (perl.beginners)
  • Re: timing a fork
    ... if ($kid) { ... That is why I want the child process to be detached. ... But, I'm new to modperl, and I think a fork doesn't copy the ... What it does is say that the parent isn't interested in ...
    (perl.beginners)
  • Re: Help (OS homework assignment in Unix)
    ... > using the fork command to create the child process. ... already have the working code in the parent process, ...
    (comp.unix.programmer)
  • Re: [9fans] APE fork()
    ... fork creates a child process that differs from the parent ... is an exact copy of the calling process (parent process) except for the ... The child process has its own copy of the parent's descriptors. ...
    (comp.os.plan9)