child's current working directory, or null to inherit parent's
child's argument vector
child's environment, or null to inherit parent's
flags from GLib.SpawnFlags
Optionalchild_setup: SpawnChildSetupFuncfunction to run in the child just before exec()
true on success, false if error is set
Executes a child program asynchronously.
See
g_spawn_async_with_pipes_and_fds()for a full description; this function simply calls theg_spawn_async_with_pipes()without any pipes, which in turn callsg_spawn_async_with_pipes_and_fds().You should call
g_spawn_close_pid()on the returned child process reference when you don't need it any more.If you are writing a GTK application, and the program you are spawning is a graphical application too, then to ensure that the spawned program opens its windows on the right screen, you may want to use
GdkAppLaunchContext,GAppLaunchContext, or set theDISPLAYenvironment variable.Note that the returned
child_pidon Windows is a handle to the child process and not its identifier. Process handles and process identifiers are different concepts on Windows.