gmain: Move doc comment for g_steal_fd() to be next to the code

Nobody’s going to keep it up to date if it’s floating about in an
unrelated place, not next to the code.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
Philip Withnall 2024-10-01 14:19:30 +01:00
parent a960725b5d
commit f9d1f614a9
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73
2 changed files with 21 additions and 21 deletions

View File

@ -6571,24 +6571,3 @@ g_get_worker_context (void)
return glib_worker_context;
}
/**
* g_steal_fd:
* @fd_ptr: (not optional) (inout): A pointer to a file descriptor
*
* Sets @fd_ptr to `-1`, returning the value that was there before.
*
* Conceptually, this transfers the ownership of the file descriptor
* from the referenced variable to the caller of the function (i.e.
* steals the reference). This is very similar to [func@GLib.steal_pointer],
* but for file descriptors.
*
* On POSIX platforms, this function is async-signal safe
* (see [`signal(7)`](man:signal(7)) and
* [`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
* signal handler or a #GSpawnChildSetupFunc.
*
* This function preserves the value of `errno`.
*
* Returns: the value that @fd_ptr previously had
* Since: 2.70
*/

View File

@ -984,6 +984,27 @@ void g_main_context_invoke (GMainContext *context,
GSourceFunc function,
gpointer data);
/**
* g_steal_fd:
* @fd_ptr: (not optional) (inout): A pointer to a file descriptor
*
* Sets @fd_ptr to `-1`, returning the value that was there before.
*
* Conceptually, this transfers the ownership of the file descriptor
* from the referenced variable to the caller of the function (i.e.
* steals the reference). This is very similar to [func@GLib.steal_pointer],
* but for file descriptors.
*
* On POSIX platforms, this function is async-signal safe
* (see [`signal(7)`](man:signal(7)) and
* [`signal-safety(7)`](man:signal-safety(7))), making it safe to call from a
* signal handler or a #GSpawnChildSetupFunc.
*
* This function preserves the value of `errno`.
*
* Returns: the value that @fd_ptr previously had
* Since: 2.70
*/
GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
static inline int g_steal_fd (int *fd_ptr);