process-api: ProcessBuilder and Process API module (pipe-buffer deadlock and its fixes, timeouts and process-tree kill, grandchild holding the pipe, environment/redirect/stdin, ProcessHandle, startPipeline, shell and option injection), ProcessRunner, 14 contract tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b3W3uHbHAmM3orhn7b
This commit is contained in:
Ankur
2026-11-26 00:48:44 +05:30
co-authored by Claude Sonnet 5.5
parent 47e4ccbefa
commit a714780bca
21 changed files with 952 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
== 1. the child inherits a COPY of our environment
child sees : GREETING=hello MODE=
our own env: GREETING=null (unchanged)
== 2. clear() and rebuild: pass only what the child needs
child sees : HOME=[] PATH=[/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] MODE=[minimal]
== 3. which PATH finds the program? start() uses OURS; the child's PATH is for the child
start("date") with child PATH=/nonexistent : true (resolved with the parent's PATH)
sh -c 'date +%Y' with child PATH=/nonexistent : sh: 1: date: not found
== 4. working directory
ls in temp dir: marker.txt
bad directory -> IOException: Cannot run program "ls" (in directory "/no/such/dir"): Exec failed, error: 2 (No such file or directory)
== 5. redirect to files: no pipe, so nothing to drain
exit 0, file contains: to-stdout | to-stderr |
getInputStream() on a redirected process is a null stream: read() = -1
== 6. stdin: close it, or a reader like cat never sees EOF
cat echoed: line one | line two | exit 0