1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00
serenity/Base/usr/share/man/man2/recvfd.md
Andreas Kling 55a22b50c9 Base: Fix wording in recvfd(2)
recvfd() returns a *non-negative* integer on success. 0 is a valid fd.
2020-06-25 10:58:37 +02:00

964 B

Name

recvfd - receive a file descriptor from a local socket peer

Synopsis

#include <sys/socket.h>

int recvfd(int sockfd);

Description

Receive an open file descriptor from a local socket peer connected via sockfd. This is a non-blocking call that will fail if there is no file descriptor waiting in the socket's queue.

File descriptors are sent out-of-band and do not affect the regular data streams.

Return value

If a file descriptor is successfully received, it is returned as a non-negative integer. Otherwise, -1 is returned and errno is set to indicate the error.

Errors

  • EBADF: sockfd is not an open file descriptor.
  • ENOTSOCK: sockfd does not refer to a socket.
  • EAFNOSUPPORT: sockfd does not refer to a local domain socket.
  • EINVAL: sockfd does not refer to a connected or accepted socket.
  • EAGAIN: There is no file descriptor queued on this socket.

See also