Gio.UnixFDList.get

### Method

# Gio UnixFDListget

since: 2.24

#### Declaration [src]

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

#### Description [src]

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. Either use `g_unix_fd_list_lookup()` to do a checked lookup, or check the index against the list length using `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_`

  Type: `int`

  The index into the list.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `int`

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