Basics
Guides
API Reference
Basics
Guides
API Reference
[20:7] extends: object
A GUnixFDList contains a list of file descriptors. It owns the file
descriptors that it contains, closing them when finalized. It may be wrapped
in a GUnixFDMessage and sent over a
[class@Gio.Socket] in the G_SOCKET_FAMILY_UNIX family by using
[method@Gio.Socket.send_message] and received using
[method@Gio.Socket.receive_message]. Before 2.74, <gio/gunixfdlist.h>
belonged to the UNIX-specific GIO interfaces, thus you had to use the
gio-unix-2.0.pc pkg-config file when using it. Since 2.74, the API is
available for Windows.
UnixFDList ()
Creates a new #GUnixFDList containing no file descriptors.
toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.append (int fd)
Adds a file descriptor to @list. The file descriptor is duplicated using dup(). You keep your copy of the descriptor and the copy contained in
will be closed when @list is finalized. A possible cause of failure is exceeding the per-process or system-wide file descriptor limit. The index of the file descriptor in the list is returned. If you use this index with g_unix_fd_list_get() then you will receive back a duplicated copy of the same file descriptor.fd is a valid open file descriptor.get (int index_)
Gets a file descriptor out of @list. @index_ specifies the index of the file descriptor to get. It is a programmer error for @index_ to be out of range; see g_unix_fd_list_get_length(). The file descriptor is duplicated using dup() and set as close-on-exec before being returned. You must call close() on it when you are done. A possible cause of failure is exceeding the per-process or system-wide file descriptor limit.
index_ is the index into the list.get_length ()
Gets the length of @list (ie: the number of file descriptors contained within).
[146:14] static extends: object
Alternate constructors for UnixFDList. Usage:
UnixFDListCtors.<name>(...). The primary constructor lives
directly on UnixFDList.
newFromArray (list fds)
Creates a new #GUnixFDList containing the file descriptors given in @fds. The file descriptors become the property of the new list and may no longer be used by the caller. The array itself is owned by the caller. Each file descriptor in the array should be set to close-on-exec. If
is -1 then @fds must be terminated with -1.fds is the initial list of file descriptors.n_fds is the length of #fds, or -1.A new UnixFDList.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.