### Method

# Xdp Portal spawn

#### Declaration [src]

    void
    xdp_portal_spawn (
      XdpPortal* portal,
      const char* cwd,
      const char* const* argv,
      int* fds,
      int* map_to,
      int n_fds,
      const char* const* env,
      XdpSpawnFlags flags,
      const char* const* sandbox_expose,
      const char* const* sandbox_expose_ro,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer data
    )

#### Description [src]

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 `XdpPortal::spawn-exited` signal.

#### Parameters

`cwd` | `const char*`
| The cwd for the new process.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`argv` | An array of `char*`
| The argv for the new process.
| The array must be `NULL`-terminated.
| The data is owned by the caller of the function.
| Each element is a NUL terminated UTF-8 string.
`fds` | An array of `int`
| An array of open fds to pass to the new process, or `NULL`
| The argument can be `NULL`.
| The length of the array is specified in the `n_fds` argument.
| The data is owned by the caller of the function.
`map_to` | An array of `int`
| An array of integers to map the `fds` to, or `NULL`. Must be the same length as `fds`.
| The argument can be `NULL`.
| The length of the array is specified in the `n_fds` argument.
| The data is owned by the caller of the function.
`n_fds` | `int`
| The length of `fds` and `map_to` arrays.
`env` | An array of `char*`
| An array of KEY=VALUE environment settings, or `NULL`
| The argument can be `NULL`.
| The array must be `NULL`-terminated.
| The data is owned by the caller of the function.
| Each element is a NUL terminated UTF-8 string.
`flags` | `XdpSpawnFlags`
| Flags influencing the spawn operation.
`sandbox_expose` | An array of `char*`
| Paths to expose rw in the new sandbox, or `NULL`
| The argument can be `NULL`.
| The array must be `NULL`-terminated.
| The data is owned by the caller of the function.
| Each element is a NUL terminated UTF-8 string.
`sandbox_expose_ro` | An array of `char*`
| Paths to expose ro in the new sandbox, or `NULL`
| The argument can be `NULL`.
| The array must be `NULL`-terminated.
| The data is owned by the caller of the function.
| Each element is a NUL terminated UTF-8 string.
`cancellable` | `GCancellable`
| Optional `GCancellable`
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`callback` | `GAsyncReadyCallback`
| A callback to call when the request is done.
| The argument can be `NULL`.
`data` | `gpointer`
| Data to pass to `callback`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.