Expand description
bun_spawn_sys — raw OS process-spawn layer split out of bun_spawn.
This crate owns everything that talks directly to the kernel/libuv to create a child process and read its exit status, with no event-loop integration:
posix_spawn(2)libc wrappers (Actions/Attr/spawn_z/wait4)- the
posix_spawn_bunrepr(C) request structs and FFI decl spawn_process_posix(fd plumbing +posix_spawncall)PosixSpawnOptions/PosixStdio/PosixSpawnResult/ExtraPipe/StdioKind/Dup2/Rusage- signal-forwarding / no-orphans
extern "C"decls
Dependencies are deliberately leaf-only: libc, bun_sys, bun_core,
bun_analytics, and (Windows-only) bun_libuv_sys. There is no
bun_event_loop/bun_io/bun_io/bun_threading dependency — Process,
Poller, WaiterThread, and the sync runner stay in bun_spawn and
depend on this crate.
See docs/SPAWN_SYS_PROPOSAL.md for the full crate-graph rationale.
Re-exports§
pub use spawn_process::spawn_process_posix;pub use spawn_process::Dup2;pub use spawn_process::ExtraPipe;pub use spawn_process::FdT;pub use spawn_process::IoCounters;pub use spawn_process::PidFdType;pub use spawn_process::PidT;pub use spawn_process::PosixSpawnOptions;pub use spawn_process::PosixSpawnResult;pub use spawn_process::PosixStdio;pub use spawn_process::Rusage;pub use spawn_process::RusageFields;pub use spawn_process::StdioKind;pub use spawn_process::WinRusage;pub use spawn_process::WinTimeval;pub use spawn_process::rusage_zeroed;
Modules§
- ffi
- pdeathsig
- posix_
spawn - posix_spawn(2) FFI wrappers (Actions / Attr / spawn_z / wait4).
Port of
src/runtime/api/bun/spawn.zig. - spawn_
process spawn_process_posix+ option/result structs +Rusage. Split out ofsrc/spawn/process.rs. Rawspawn_process_posix+ option/result types — split out ofbun_spawn::processso the fd/action plumbing has no event-loop dependency.Process/Poller/WaiterThread/syncstay inbun_spawn.- waiter_
thread_ flag
Type Aliases§
- Argv
[*:null]?[*:0]const u8— null-terminated array of NUL-terminated C strings (theargvshapeposix_spawn/execveaccept). Build asVec<*const c_char>with a trailingcore::ptr::null(), then.as_ptr().- CStrPtr
- Element type for an owned
Vecbacking anArgv/Envp. Null is the sentinel; never wrap inOption. - Envp
- Same shape as
Argvfor the environment block.