mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 09:26:17 +01:00
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:
parent
a960725b5d
commit
f9d1f614a9
21
glib/gmain.c
21
glib/gmain.c
@ -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
|
||||
*/
|
||||
|
21
glib/gmain.h
21
glib/gmain.h
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user