Documentation
¶
Overview ¶
Package posixsubprocess is the gopy port of CPython's Modules/_posixsubprocess.c. It backs subprocess.py with the low-level fork+exec primitive on POSIX systems.
CPython: Modules/_posixsubprocess.c:1 _posixsubprocess module
The full C implementation calls clone(2)/vfork(2) directly, closes file descriptors in the child, and communicates pre-exec errors through errpipe_write. In gopy the same observable contract is satisfied by exec.Cmd: stdin/stdout/stderr fd remapping is done via the Cmd.Stdin/Stdout/Stderr fields, and the process is started with Cmd.Start() which returns the PID.
The 24-argument fork_exec signature is kept verbatim so that the vendored subprocess.py can call _posixsubprocess.fork_exec without modification.