You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fd inheritance - per-process stdio & fd inheritance for spawned children (#416)
* Don't open timer.device any tyme a pthread timed function is called
* Fixed uuid created as local memory variable
* Refactor debug output formatting
* fd inheritance: implement per-process stdio and fd inheritance for spawned children
- Move struct iob __sf[3] and struct _glue __sglue from shared globals
to per-process heap-allocated fields in struct _clib4 (dos.h, clib4.h).
Each process now has isolated stdio state; child cleanup no longer
corrupts the parent's stdio buffers.
- stdio_file_init (file_init.c) allocates per-process iob structs and
the root glue node on the heap. __close_all_files (init_exit.c) frees
them. __stdin/__stdout/__stderr (__std.c) and _fwalk (fwalk.c) use the
per-process pointers. findfp.c and stdio_headers.h updated accordingly.
- fd inheritance: parent encodes open fds >= 3 as a spec string
(fd:flags:handle_or_token;) passed via spawnData.fdInherit.
PIPE: handles are stored as symbolic tokens STDIN/STDOUT/STDERR so the
child uses Input()/Output()/ErrorOutput() instead of a disconnected
DupFileHandle copy (AmigaOS4 PIPE: limitation).
- children.c: insertSpawnedChildren gains fdInherit param; new functions
import_inherited_fds_from_spec and import_pending_fds_for_process.
FDF_NO_CLOSE_BPTR set for symbolic-token handles.
- clib4.c (libOpen): added existing->self == _me guard so NP_Child TRUE
children are not mistaken for the parent and get their own _clib4 +
run import_pending_fds_for_process after _start_ctors.
- Extract build_fd_inherit_spec / close_fd_inherit_spec_handles into
spawn_utils.c / spawn_utils.h (shared by spawnvpe, spawnv, popen).
spawnvpe passes the explicit fhin/fhout/fherr for token detection;
spawnv and popen pass -1/-1/-1 (no stdio redirection).
- spawnData changed from stack-allocated struct to heap-allocated pointer
(ownership transferred to spawnedProcessEnter / Clib4Children).
NP_CopyVars TRUE added to spawnv and popen SystemTags calls.
- Remove all debug DOS Printf calls added during development.
0 commit comments