*/
/**
- * SECTION: gunixfdlist
+ * SECTION:gunixfdlist
* @title: GUnixFDList
- * @short_description: An object containing a set of file descriptors
+ * @short_description: An object containing a set of UNIX file descriptors
+ * @include: gio/gunixfdlist.h
* @see_also: #GUnixFDMessage
*
* A #GUnixFDList contains a list of file descriptors. It owns the file
* It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
* the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
* and received using g_socket_receive_message().
+ *
+ * Note that <filename><gio/gunixfdlist.h></filename> belongs to
+ * the UNIX-specific GIO interfaces, thus you have to use the
+ * <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
*/
-#define _GNU_SOURCE /* for F_DUPFD_CLOEXEC */
-
#include "config.h"
#include <sys/types.h>
#include "gunixfdlist.h"
#include "gioerror.h"
-#include "gioalias.h"
G_DEFINE_TYPE (GUnixFDList, g_unix_fd_list, G_TYPE_OBJECT)
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (saved_errno),
"dup: %s", g_strerror (saved_errno));
- close (new_fd);
return -1;
}
/**
* g_unix_fd_list_new_from_array:
- * @fds: the initial list of file descriptors
+ * @fds: (array length=n_fds): the initial list of file descriptors
* @n_fds: the length of #fds, or -1
*
* Creates a new #GUnixFDList containing the file descriptors given in
/**
* g_unix_fd_list_steal_fds:
* @list: a #GUnixFDList
- * @length: pointer to the length of the returned array, or %NULL
+ * @length: (out) (allow-none): pointer to the length of the returned
+ * array, or %NULL
*
* Returns the array of file descriptors that is contained in this
* object.
* This function never returns %NULL. In case there are no file
* descriptors contained in @list, an empty array is returned.
*
- * Returns: an array of file descriptors
+ * Returns: (array length=length) (transfer full): an array of file
+ * descriptors
*
* Since: 2.24
*/
/**
* g_unix_fd_list_peek_fds:
* @list: a #GUnixFDList
- * @length: pointer to the length of the returned array, or %NULL
+ * @length: (out) (allow-none): pointer to the length of the returned
+ * array, or %NULL
*
* Returns the array of file descriptors that is contained in this
* object.
* This function never returns %NULL. In case there are no file
* descriptors contained in @list, an empty array is returned.
*
- * Returns: an array of file descriptors
+ * Returns: (array length=length) (transfer none): an array of file
+ * descriptors
*
* Since: 2.24
*/
return list->priv->nfd;
}
-
-#define __G_UNIX_FD_LIST_C__
-#include "gioaliasdef.c"