Sets a function to be called when the child indicated by
exits, at a default priority,
If you obtain
you will need to pass
G_SPAWN_DO_NOT_REAP_CHILD as flag to
the spawn function for the child watching to work.
Note that on platforms where
GPid must be explicitly closed
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.
GLib supports only a single callback per process id.
On POSIX platforms, the same restrictions mentioned for
g_child_watch_source_new() apply to this function.
This internally creates a main loop source using
g_child_watch_source_new() and attaches it to the main loop context
using g_source_attach(). You can do these steps manually if you
need greater control.
|This function is not directly available to language bindings|
|The implementation of this function is provided by |
Process id to watch. On POSIX the positive pid of a child process. On Windows a handle for a process (which doesn’t have to be a child).
Function to call.
Data to pass to
|The argument can be |
|The data is owned by the caller of the function.|