[This question is for UNIX/Linux users.] Use function fork to spawn a child and let the child exit without leaving an entry in the process table.
What will be an ideal response?
```
#!/usr/local/bin/python
import os
import signal
import time
import sys
pid = os.fork() # create child
signal.signal( signal.SIGCHLD, signal.SIG_IGN ) # ignore sigchld
if pid != 0: # parent
time.sleep( 1 )
print "Child should be removed already from process table"
elif pid == 0: # child
time.sleep( 0.5 )
print "Child exiting..."
else: # could not create child
sys.exit( "Error forking child." )
```
Child exiting...
Child should be removed already from process table
You might also like to view...
In what library is the function atof found?
A.
Why was microprogramming such a popular means of implementing control units in the 1980s?
What will be an ideal response?