Function scoped_task::spawn_etc

source ·
pub fn spawn_etc<'a>(
    job: impl Borrow<&'a Scoped<Job>>,
    options: SpawnOptions,
    path: &CStr,
    argv: &[&CStr],
    environ: Option<&[&CStr]>,
    actions: &mut [SpawnAction<'_>]
) -> Result<Scoped<Process>, (Status, String)>
Expand description

A convenience wrapper around fdio::spawn_etc that returns a Scoped.

Note that you must assign the return value to a local. You can use a leading underscore in the name to avoid the unused variable lint, but don’t use just _ or the process will be killed immediately. For example,

let _process = scoped_task::spawn_etc(
    &[c"hello world"],
    &mut [],
).expect("could not spawn process");