Next | Welcome to my ~/bin | 5 |
The fork function clones the current process
There is one process before the fork, two after
What's the return value from fork?
fork returns false in the new process (the child process)
fork returns true in the old process (the parent process)
So:
if (fork) { # I am the parent } else { # I am the child }
How about this?
if (fork) { exit; } # I am the child
How about this?
# IDIOM fork && exit; # Run in the background
Next | Menu | Copyright © 2005 M. J. Dominus |