Gio.UnixFDList.prototype.append

function append(fd: Number(gint)): Number(gint) {
    // Gjs wrapper for g_unix_fd_list_append()
}
  

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 list 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 Gio.UnixFDList.prototype.get then you will receive back a duplicated copy of the same file descriptor.

Since 2.24

fd

a valid open file descriptor

Returns

the index of the appended fd in case of success, else -1 (and @error is set)