pub fn spawn<'a>(
job: impl Borrow<&'a Scoped<Job>>,
options: SpawnOptions,
path: &CStr,
argv: &[&CStr],
) -> Result<Scoped<Process>, Status>
Expand description
A convenience wrapper around fdio::spawn
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(
&scoped_task::job_default(),
SpawnOptions::CLONE_ALL,
c"/pkg/bin/echo",
&[c"hello world"],
).expect("could not spawn process");