glib/docs/reference
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
..
gio docs: Add 2.76 release series documentation pages to the build 2022-10-14 16:03:29 +01:00
glib gstdio: Add g_clear_fd() and g_autofd 2022-10-26 19:05:33 +01:00
gobject gboxed: Add GBookmarkFile as Boxed types 2022-10-14 16:40:56 +01:00
.gitignore .gitignore manpages (*.1) 2010-05-24 23:21:01 -04:00
AUTHORS Initial revision 1999-08-16 17:58:30 +00:00
COPYING Initial revision 1999-08-16 17:58:30 +00:00
meson.build Fix symbol visibility macros on Windows 2022-10-13 20:53:56 -04:00
NEWS Initial revision 1999-08-16 17:58:30 +00:00