From 790131687cd06b6c4eae0adf0e29d025403ad891 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 23 Nov 2023 12:46:18 +0000 Subject: [PATCH] docs: Move the unix SECTION Move it to a separate page. Signed-off-by: Philip Withnall Helps: #3037 --- docs/reference/glib/glib.toml.in | 1 + docs/reference/glib/meson.build | 1 + docs/reference/glib/unix.md | 48 ++++++++++++++++++++++++++++++++ glib/glib-unix.c | 15 ---------- 4 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 docs/reference/glib/unix.md diff --git a/docs/reference/glib/glib.toml.in b/docs/reference/glib/glib.toml.in index a725ffdc4..b1c679580 100644 --- a/docs/reference/glib/glib.toml.in +++ b/docs/reference/glib/glib.toml.in @@ -70,6 +70,7 @@ content_files = [ "atomic.md", "threads.md", "spawn.md", + "unix.md", "random.md", "markup.md", "base64.md", diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build index 4a49f1f6f..9e633b805 100644 --- a/docs/reference/glib/meson.build +++ b/docs/reference/glib/meson.build @@ -175,6 +175,7 @@ expand_content_files = [ 'spawn.md', 'string-utils.md', 'unicode.md', + 'unix.md', 'uuid.md', 'version.md', ] diff --git a/docs/reference/glib/unix.md b/docs/reference/glib/unix.md new file mode 100644 index 000000000..fa446c5c4 --- /dev/null +++ b/docs/reference/glib/unix.md @@ -0,0 +1,48 @@ +Title: Unix-specific Utilities +SPDX-License-Identifier: LGPL-2.1-or-later +SPDX-FileCopyrightText: 2011 Colin Walters + +# Unix-specific Utilities + +Most of GLib is intended to be portable; in contrast, this set of +functions is designed for programs which explicitly target Unix, +or are using it to build higher level abstractions which would be +conditionally compiled if the platform matches `G_OS_UNIX`. + +To use these functions, you must explicitly include the +`glib-unix.h` header. + +## File Descriptors + + * [func@GLib.unix_open_pipe] + * [func@GLib.unix_set_fd_nonblocking] + +## Pipes + +The [struct@GLib.UnixPipe] structure can be used to conveniently open and +manipulate a Unix pipe. + + +The methods for it are all static inline for efficiency. They are: + + * `g_unix_pipe_open()` + * `g_unix_pipe_get()` + * `g_unix_pipe_steal()` + * `g_unix_pipe_close()` + * `g_unix_pipe_clear()` + +## Signals + + * [func@GLib.unix_signal_add] + * [func@GLib.unix_signal_add_full] + * [func@GLib.unix_signal_source_new] + +## Polling + + * [func@GLib.unix_fd_add] + * [func@GLib.unix_fd_add_full] + * [func@GLib.unix_fd_source_new] + +## User Database + + * [func@GLib.unix_get_passwd_entry] diff --git a/glib/glib-unix.c b/glib/glib-unix.c index 1fd06eff0..a7716fb7f 100644 --- a/glib/glib-unix.c +++ b/glib/glib-unix.c @@ -44,21 +44,6 @@ G_STATIC_ASSERT (G_ALIGNOF (GPid) == G_ALIGNOF (pid_t)); * might not be true everywhere. */ G_STATIC_ASSERT (O_NONBLOCK != FD_CLOEXEC); -/** - * SECTION:gunix - * @title: UNIX-specific utilities and integration - * @short_description: pipes, signal handling - * @include: glib-unix.h - * - * Most of GLib is intended to be portable; in contrast, this set of - * functions is designed for programs which explicitly target UNIX, - * or are using it to build higher level abstractions which would be - * conditionally compiled if the platform matches %G_OS_UNIX. - * - * To use these functions, you must explicitly include the - * "glib-unix.h" header. - */ - G_DEFINE_QUARK (g-unix-error-quark, g_unix_error) static gboolean