*
* Copyright © 2009 Codethink Limited
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2 of the licence or (at
- * your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
* See the included COPYING file for more information.
*
* 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.
+ * Note that `<gio/gunixfdlist.h>` belongs to the UNIX-specific GIO
+ * interfaces, thus you have to use the `gio-unix-2.0.pc` pkg-config
+ * file when using it.
*/
+/**
+ * GUnixFDList:
+ *
+ * #GUnixFDList is an opaque data structure and can only be accessed
+ * using the following functions.
+ **/
+
#include "config.h"
#include <unistd.h>
list->priv->fds = g_new (gint, n_fds + 1);
list->priv->nfd = n_fds;
- memcpy (list->priv->fds, fds, sizeof (gint) * n_fds);
+ if (n_fds > 0)
+ memcpy (list->priv->fds, fds, sizeof (gint) * n_fds);
list->priv->fds[n_fds] = -1;
return list;
/**
* g_unix_fd_list_steal_fds:
* @list: a #GUnixFDList
- * @length: (out) (allow-none): pointer to the length of the returned
+ * @length: (out) (optional): pointer to the length of the returned
* array, or %NULL
*
* Returns the array of file descriptors that is contained in this
/**
* g_unix_fd_list_peek_fds:
* @list: a #GUnixFDList
- * @length: (out) (allow-none): pointer to the length of the returned
+ * @length: (out) (optional): pointer to the length of the returned
* array, or %NULL
*
* Returns the array of file descriptors that is contained in this