Method

GioUnixFDListget

Declaration

gint
g_unix_fd_list_get (
  GUnixFDList* list,
  gint index_,
  GError** error
)

Description

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.

Available since:2.24

Parameters

index_ gint
 

The index into the list.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gint
 

The file descriptor, or -1 in case of error.