Child.watchSourceNew

Creates a new child_watch source. The source will not initially be associated with any GMainContext and must be added to one with g_source_attach() before it will be executed. Note that child watch sources can only be used in conjunction with g_spawn... when the G_SPAWN_DO_NOT_REAP_CHILD flag is used. Note that on platforms where GPid must be explicitly closed (see g_spawn_close_pid()) pid must not be closed while the source is still active. Typically, you will want to call g_spawn_close_pid() in the callback function for the source. Note further that using g_child_watch_source_new() is not compatible with calling waitpid(-1) in the application. Calling waitpid() for individual pids will still work fine. Since 2.4

class Child
static
watchSourceNew

Parameters

pid GPid

process to watch. On POSIX the pid of a child process. On Windows a handle for a process (which doesn't have to be a child).

Return Value

Type: Source

the newly-created child watch source

Meta