glib/docs
Simon McVittie b393413321 gstdio: Add g_clear_fd() and g_autofd
Inspired by libglnx's glnx_close_fd() and glnx_autofd, these let us
have the same patterns as g_clear_object() and g_autoptr(GObject), but
for file descriptors. g_clear_fd() is cross-platform, while g_autofd
is syntactic sugar requiring a supported compiler (gcc or clang).

Now that g_close() checks for EBADF as a programming error, we can
implement the equivalent of glnx_autofd as an inline function without
needing to have errno and EBADF in the header file.

g_clear_fd() is like glnx_close_fd(), but with error checking.
The private _g_clear_fd_ignore_error() function used to implement
g_autofd is a closer equivalent of glnx_close_fd().

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-26 19:05:33 +01:00
..
reference gstdio: Add g_clear_fd() and g_autofd 2022-10-26 19:05:33 +01:00
backports.md docs: Add a backports policy 2022-05-19 12:52:26 +01:00
CODEOWNERS docs: Sync glib.doap to set of users listed in CODEOWNERS 2022-06-22 15:54:49 +01:00
debugging.txt tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
macros.txt build: Add glib_debug option 2021-01-20 16:05:36 +01:00
meson-version.md docs: Add a Meson version policy 2022-05-06 13:01:44 +01:00
rationales.md docs: Move README.rationale to docs subdirectory 2022-05-11 13:02:49 +01:00
releasing.md docs: Document the release process 2022-06-21 16:16:10 +01:00
roadmap.md docs: Document the release process 2022-06-21 16:16:10 +01:00
supported-platforms.md docs: Update supported platforms list 2022-05-18 08:36:50 +01:00
testing.md docs: Add a testing policy 2022-06-14 15:19:32 +01:00
toolchain-requirements.md Require C99's __VA_ARGS__ 2022-06-30 01:46:32 +01:00