spawn


Description:

public async int spawn (string cwd, string[] argv, int[]? fds, int[]? map_to, string[]? env, SpawnFlags flags, string[]? sandbox_expose, string[]? sandbox_expose_ro, Cancellable? cancellable) throws Error

Creates a new copy of the applications sandbox, and runs a process in, with the given arguments.

The learn when the spawned process exits, connect to the [signal@Portal:XdpPortal:spawn-exited] signal.

Parameters:

this

a [class@Portal]

cwd

the cwd for the new process

argv

the argv for the new process

fds

an array of open fds to pass to the new process, or `NULL`

map_to

an array of integers to map the fds to, or `NULL`. Must be the same length as fds

env

an array of KEY=VALUE environment settings, or `NULL`

flags

flags influencing the spawn operation

sandbox_expose

paths to expose rw in the new sandbox, or `NULL`

sandbox_expose_ro

paths to expose ro in the new sandbox, or `NULL`

cancellable

optional [class@Gio.Cancellable]

callback

a callback to call when the request is done

data

data to pass to callback

n_fds

the length of fds and map_to arrays