### Method

# Gio UnixFDMessage steal_fds

since: 2.22

#### Declaration

    gint*
    g_unix_fd_message_steal_fds (
      GUnixFDMessage* message,
      gint* length
    )

#### Description

Returns the array of file descriptors that is contained in this object.

After this call, the descriptors are no longer contained in `message`. Further calls will return an empty list (unless more descriptors have been added).

The return result of this function must be freed with g_free(). The caller is also responsible for closing all of the file descriptors.

If `length` is non-`NULL` then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.

This function never returns `NULL`. In case there are no file descriptors contained in `message`, an empty array is returned.

Available since: 2.22

#### Parameters

`length`

  Type: `gint*`

  Pointer to the length of the returned array, or `NULL`.

  The argument will be set by the function.
  The argument can be `NULL`.

#### Return value

Type: An array of `gint`

An array of file descriptors.

The length of the array is in the `length` argument.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.