Function

GLibspawn_async_with_fds

Declaration [src]

gboolean
g_spawn_async_with_fds (
  const gchar* working_directory,
  gchar** argv,
  gchar** envp,
  GSpawnFlags flags,
  GSpawnChildSetupFunc child_setup,
  gpointer user_data,
  GPid* child_pid,
  gint stdin_fd,
  gint stdout_fd,
  gint stderr_fd,
  GError** error
)

Description [src]

Executes a child program asynchronously.

Identical to g_spawn_async_with_pipes_and_fds() but with n_fds set to zero, so no FD assignments are used.

Available since:2.58

Parameters

working_directory const gchar*
 

Child’s current working directory, or NULL to inherit parent’s, in the GLib file name encoding.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The string is a file system path, using the OS encoding.
argv An array of gchar*
 

Child’s argument vector, in the GLib file name encoding.

 The data is owned by the caller of the function.
envp An array of gchar*
 

Child’s environment, or NULL to inherit parent’s, in the GLib file name encoding.

 The argument can be NULL.
 The data is owned by the caller of the function.
flags GSpawnFlags
 

Flags from GSpawnFlags.

child_setup GSpawnChildSetupFunc
 

Function to run in the child just before exec()

user_data gpointer
 

User data for child_setup.

child_pid GPid
 

Return location for child process ID, or NULL.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.
stdin_fd gint
 

File descriptor to use for child’s stdin, or -1

stdout_fd gint
 

File descriptor to use for child’s stdout, or -1

stderr_fd gint
 

File descriptor to use for child’s stderr, or -1

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE on success, FALSE if an error was set.