Merge branch 'wip/smcv/async-signal-safety' into 'main'

gstdio: Improve documentation of some functions as async-signal safe

See merge request GNOME/glib!3458
This commit is contained in:
Philip Withnall 2023-06-01 13:42:54 +00:00
commit d861eee868

View File

@ -1760,8 +1760,12 @@ g_utime (const gchar *filename,
*
* It is a bug to call this function with an invalid file descriptor.
*
* Since 2.76, this function is guaranteed to be async-signal-safe if (and only
* if) @error is %NULL and @fd is a valid open file descriptor.
* On POSIX platforms since GLib 2.76, this function is async-signal safe
* if (and only if) @error is %NULL and @fd is a valid open file descriptor.
* This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
* under those conditions.
* See [`signal(7)`](man:signal(7)) and
* [`signal-safety(7)`](man:signal-safety(7)) for more details.
*
* Returns: %TRUE on success, %FALSE if there was an error.
*
@ -1852,8 +1856,13 @@ g_close (gint fd,
* stored in both %errno and @error. If this function succeeds,
* %errno is undefined.
*
* This function is async-signal-safe if @error is %NULL and @fd_ptr
* points to either a negative number or a valid file descriptor.
* On POSIX platforms, this function is async-signal safe
* if @error is %NULL and @fd_ptr points to either a negative number or a
* valid open file descriptor.
* This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
* under those conditions.
* See [`signal(7)`](man:signal(7)) and
* [`signal-safety(7)`](man:signal-safety(7)) for more details.
*
* It is a programming error for @fd_ptr to point to a non-negative
* number that is not a valid file descriptor.