glib-unix: New Unix-specific API
authorColin Walters <walters@verbum.org>
Wed, 16 Mar 2011 17:54:28 +0000 (13:54 -0400)
committerColin Walters <walters@verbum.org>
Wed, 27 Apr 2011 17:29:38 +0000 (13:29 -0400)
commit0ff211f520c18550454289e7265061d7e8ac41c0
tree38d7967937c6ba43955cdd3c330ba75fc27fe4c5
parent27246c615df66ee869c2174aa6609601ff9d1f64
glib-unix: New Unix-specific API

GLib historically has been designed to be "mostly" portable; there
are some functions only available on Unix like g_io_channel_unix_new(),
but these are typically paired with obvious counterparts for Win32.

However, as GLib is used not only by portable software, but components
targeting Unix (or even just Linux), there are a few cases where it
would be very convenient if GLib shipped built-in functionality.

This initial patch is a basic wrapper around pipe2(), including
fallbacks for older kernels.  This pairs well with the
existing g_spawn_*() API and its child_setup functionality.

However, in the future, I want to add a signal() wrapper here,
complete with proxying the signal to a mainloop.  I have initial code
for this, but doing it sanely (including factoring out gmain.c's
private worker thread), is a complex task, and I don't want to block
on that.

See also gwin32.h for Win32 specific functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=644941
docs/reference/glib/glib-sections.txt
glib/Makefile.am
glib/glib-unix.c [new file with mode: 0644]
glib/glib-unix.h [new file with mode: 0644]
glib/glib.symbols
glib/gmain.c
glib/tests/Makefile.am
glib/tests/unix.c [new file with mode: 0644]