Method

GioSubprocessLaunchertake_stderr_fd

since: 2.40

Declaration

void
g_subprocess_launcher_take_stderr_fd (
  GSubprocessLauncher* self,
  gint fd
)

Description

Sets the file descriptor to use as the stderr for spawned processes.

If fd is -1 then any previously given fd is unset.

Note that the default behaviour is to pass stderr through to the stderr of the parent process.

The passed fd belongs to the GSubprocessLauncher. It will be automatically closed when the launcher is finalized. The file descriptor will also be closed on the child side when executing the spawned process.

You may not set a stderr fd if a stderr file path is already set or if the launcher flags contain any flags directing stderr elsewhere.

This feature is only available on UNIX.

Available since: 2.40

Parameters

fd

Type: gint

A file descriptor, or -1