def call(args, stdout=None, stderr=None, stdin=None, daemonize=False,<EOL>preexec_fn=None, shell=False, cwd=None, env=None):
stream = lambda s, m: s is None and os.open(os.devnull, m) or s<EOL>stdout = stream(stdout, os.O_WRONLY)<EOL>stderr = stream(stderr, os.O_WRONLY)<EOL>stdin = stream(stdin, os.O_RDONLY)<EOL>shared_pid = Value('<STR_LIT:i>', <NUM_LIT:0>)<EOL>pid = os.fork()<EOL>if pid > <NUM_LIT:0>:<EOL><INDENT>os.waitpid(pid, <NUM_LIT:0>)<EOL>child_pid = shared_pid.value<EOL>del shared_pid<EOL>if daemonize:<EOL><INDENT>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>return child_pid<EOL><DEDENT>else:<EOL><INDENT>os.setsid()<EOL>proc = subprocess.Popen(args, stdout=stdout, stderr=stderr, stdin=stdin, close_fds=True,<EOL>preexec_fn=preexec_fn, shell=shell, cwd=cwd, env=env)<EOL>shared_pid.value = proc.pid<EOL>os._exit(<NUM_LIT:0>)<EOL><DEDENT>
Run an external command in a separate process and detach it from the current process. Excepting
`stdout`, `stderr`, and `stdin` all file descriptors are closed after forking. If `daemonize`
is True then the parent process exits. All stdio is redirected to `os.devnull` unless
specified. The `preexec_fn`, `shell`, `cwd`, and `env` parameters are the same as their `Popen`
counterparts. Return the PID of the child process if not daemonized.