Function nstd_sys::proc::nstd_proc_spawn
source · #[no_mangle]
pub unsafe extern "C" fn nstd_proc_spawn(
program: &NSTDStr,
args: &NSTDSlice,
vars: &NSTDSlice
) -> Option<NSTDChildProcess>Available on crate feature
nstd_proc only.Expand description
Spawns a new child process with the name program and returns a handle to it.
Parameters:
-
const NSTDStr *program- A path to the program to run as a child process. -
const NSTDSlice *args- A slice ofNSTDStrarguments to pass to the program. -
const NSTDSlice *vars- A slice ofNSTDStr[2]key/value environment variables to give to the program.
Returns
NSTDChildProcess child - A handle to the new child process, null on error.
Panics
This operation will panic in any of the following situations:
-
args’s stride is not equal tosizeof(NSTDStr). -
vars’s stride is not equal tosizeof(NSTDStr[2]).
Safety
The user must ensure that all of program, args, and vars and their data remain valid for
reads while this function is executing.