proc_spawn2

Function proc_spawn2 

Source
pub fn proc_spawn2<M: MemorySize>(
    ctx: FunctionEnvMut<'_, WasiEnv>,
    name: WasmPtr<u8, M>,
    name_len: M::Offset,
    args: WasmPtr<u8, M>,
    args_len: M::Offset,
    envs: WasmPtr<u8, M>,
    envs_len: M::Offset,
    fd_ops: WasmPtr<ProcSpawnFdOp<M>, M>,
    fd_ops_len: M::Offset,
    signal_actions: WasmPtr<SignalDisposition, M>,
    signal_actions_len: M::Offset,
    search_path: Bool,
    path: WasmPtr<u8, M>,
    path_len: M::Offset,
    ret: WasmPtr<Pid, M>,
) -> Result<Errno, WasiError>
Expand description

Spawns a new sub-process (posix-spawn style).

Legacy delimiter-based API: args and envs are single strings with entries separated by line feeds. Prefer proc_spawn3 for proper string lists.

§Parameters

  • name - Name of the process to be spawned
  • args - List of the arguments to pass the process (entries are separated by line feeds)
  • envs - List of the environment variables to pass process

§Return

On success, writes the child PID to ret and returns Errno::Success. On failure, returns an error code.