---
name: "io_receivefd"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/io_receivefd"
---

# io\_receivefd(3)

receive a file descriptor over a Unix Domain socket

## NAME

io\_receivefd - receive a file descriptor over a Unix Domain socket

## SYNTAX

**#include \<libowfat/io.h\>**

int64 **io\_receivefd**(int64 sock);

## DESCRIPTION

io\_receivefd receives a file descriptor from the Unix Domain socket *sock*.  You can send a descriptor using [io\_passfd(3)](/io_passfd/3.md).

io\_receivefd returns -1 on error or the file descriptor.

The underlying Unix API can send more than one descriptor at the time. This function expects only one descriptor and will return the first one if more than one were sent.

## SEE ALSO

[io\_passfd(3)](/io_passfd/3.md)
