Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python fork error

import os

def _fork():
   raise OSError()
os.fork = _fork

for i in range(1,4):
    try:
         pid = os.fork()
    except OSError:
         print ("Error forking process")
         continue
    if pid == 0:
         print "In child process"
         os._exit(0)
    print "In parent process"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #fork #error
ADD COMMENT
Topic
Name
9+1 =