mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-11 18:23:07 +02:00
2005-05-05 Owen Taylor <otaylor@redhat.com> * gobject.[ch] gobject.symbols: Add g_object_add/remove_toggle_ref() functions to get notification when a reference count is the last remaining reference; this enables better memory management for language bindings. (http://mail.gnome.org/archives/gtk-devel-list/2005-April/msg00095.html) 2005-05-05 Owen Taylor <otaylor@redhat.com> * glib/gdataset.[ch] glib/gdatasetprivate.h: Add g_datalist_set/unset_flags(), g_datalist_get_flags() functions to squeeze some bits into a GDataSet... this is needed for efficient implementation of toggle references in GObject. * tests/gobject/references.c tests/gobject/Makefile.am: Add a test case for weak and toggle references. * glib/gfileutils.[ch]: Rename g_file_replace() back to g_file_set_contents(). * glib/glib.symbols: Update. 2005-05-05 Owen Taylor <otaylor@redhat.com> * glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt: Update * gobject/tmpl/objects.sgml: Document toggle-references.
185 lines
5.1 KiB
Plaintext
185 lines
5.1 KiB
Plaintext
<!-- ##### SECTION Title ##### -->
|
|
Spawning Processes
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
process launching with <function>fork()</function>/<function>exec()</function>.
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
<!-- ##### ENUM GSpawnError ##### -->
|
|
<para>
|
|
Error codes returned by spawning processes.
|
|
</para>
|
|
|
|
@G_SPAWN_ERROR_FORK: Fork failed due to lack of memory.
|
|
@G_SPAWN_ERROR_READ: Read or select on pipes failed.
|
|
@G_SPAWN_ERROR_CHDIR: Changing to working directory failed.
|
|
@G_SPAWN_ERROR_ACCES: <function>execv()</function> returned %EACCES.
|
|
@G_SPAWN_ERROR_PERM: <function>execv()</function> returned %EPERM.
|
|
@G_SPAWN_ERROR_2BIG: <function>execv()</function> returned %E2BIG.
|
|
@G_SPAWN_ERROR_NOEXEC: <function>execv()</function> returned %ENOEXEC.
|
|
@G_SPAWN_ERROR_NAMETOOLONG: <function>execv()</function> returned %ENAMETOOLONG.
|
|
@G_SPAWN_ERROR_NOENT: <function>execv()</function> returned %ENOENT.
|
|
@G_SPAWN_ERROR_NOMEM: <function>execv()</function> returned %ENOMEM.
|
|
@G_SPAWN_ERROR_NOTDIR: <function>execv()</function> returned %ENOTDIR.
|
|
@G_SPAWN_ERROR_LOOP: <function>execv()</function> returned %ELOOP.
|
|
@G_SPAWN_ERROR_TXTBUSY: <function>execv()</function> returned %ETXTBUSY.
|
|
@G_SPAWN_ERROR_IO: <function>execv()</function> returned %EIO.
|
|
@G_SPAWN_ERROR_NFILE: <function>execv()</function> returned %ENFILE.
|
|
@G_SPAWN_ERROR_MFILE: <function>execv()</function> returned %EMFILE.
|
|
@G_SPAWN_ERROR_INVAL: <function>execv()</function> returned %EINVAL.
|
|
@G_SPAWN_ERROR_ISDIR: <function>execv()</function> returned %EISDIR.
|
|
@G_SPAWN_ERROR_LIBBAD: <function>execv()</function> returned %ELIBBAD.
|
|
@G_SPAWN_ERROR_FAILED: Some other fatal failure, <literal>error->message</literal> should explain.
|
|
|
|
<!-- ##### MACRO G_SPAWN_ERROR ##### -->
|
|
<para>
|
|
Error domain for spawning processes. Errors in this domain will
|
|
be from the #GSpawnError enumeration. See #GError for information on
|
|
error domains.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### ENUM GSpawnFlags ##### -->
|
|
<para>
|
|
Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
|
|
</para>
|
|
|
|
@G_SPAWN_LEAVE_DESCRIPTORS_OPEN: the parent's open file descriptors will be
|
|
inherited by the child; otherwise all descriptors except stdin/stdout/stderr
|
|
will be closed before calling <function>exec()</function> in the child.
|
|
@G_SPAWN_DO_NOT_REAP_CHILD: the child will not be automatically reaped; you
|
|
must call <function>waitpid()</function> or handle <literal>SIGCHLD</literal>
|
|
yourself, or the child will become a zombie.
|
|
@G_SPAWN_SEARCH_PATH: <literal>argv[0]</literal> need not be an absolute path,
|
|
it will be looked for in the user's <envar>PATH</envar>.
|
|
@G_SPAWN_STDOUT_TO_DEV_NULL: the child's standad output will be discarded,
|
|
instead of going to the same location as the parent's standard output.
|
|
@G_SPAWN_STDERR_TO_DEV_NULL: the child's standard error will be discarded.
|
|
@G_SPAWN_CHILD_INHERITS_STDIN: the child will inherit the parent's standard
|
|
input (by default, the child's standard input is attached to
|
|
<filename>/dev/null</filename>).
|
|
@G_SPAWN_FILE_AND_ARGV_ZERO: the first element of <literal>argv</literal> is
|
|
the file to execute, while the remaining elements are the actual argument
|
|
vector to pass to the file. Normally g_spawn_async_with_pipes() uses
|
|
<literal>argv[0]</literal> as the file to execute, and passes all of
|
|
<literal>argv</literal> to the child.
|
|
|
|
<!-- ##### USER_FUNCTION GSpawnChildSetupFunc ##### -->
|
|
<para>
|
|
Specifies the type of the setup function passed to g_spawn_async(),
|
|
g_spawn_sync() and g_spawn_async_with_pipes(). On POSIX platforms it
|
|
is called in the child after GLib has performed all the setup it plans
|
|
to perform but before calling <function>exec()</function>. On POSIX
|
|
actions taken in this function will thus only affect the child, not
|
|
the parent.
|
|
</para>
|
|
|
|
<para>
|
|
On Windows the function is called in the parent. Its usefulness on
|
|
Windows is thus questionable. In many cases executing the child setup
|
|
function in the parent can have ill effects, and you should be very
|
|
careful when porting software to Windows that uses child setup
|
|
functions.
|
|
</para>
|
|
|
|
@user_data: user data to pass to the function.
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_async_with_pipes ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@working_directory:
|
|
@argv:
|
|
@envp:
|
|
@flags:
|
|
@child_setup:
|
|
@user_data:
|
|
@child_pid:
|
|
@standard_input:
|
|
@standard_output:
|
|
@standard_error:
|
|
@error:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_async ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@working_directory:
|
|
@argv:
|
|
@envp:
|
|
@flags:
|
|
@child_setup:
|
|
@user_data:
|
|
@child_pid:
|
|
@error:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_sync ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@working_directory:
|
|
@argv:
|
|
@envp:
|
|
@flags:
|
|
@child_setup:
|
|
@user_data:
|
|
@standard_output:
|
|
@standard_error:
|
|
@exit_status:
|
|
@error:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_command_line_async ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@command_line:
|
|
@error:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_command_line_sync ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@command_line:
|
|
@standard_output:
|
|
@standard_error:
|
|
@exit_status:
|
|
@error:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_spawn_close_pid ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@pid:
|
|
|
|
|