Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SENDFD(3)		   Library Functions Manual		     SENDFD(3)

NAME
       sendfd, recvfd -	pass file descriptors along Unix domain	sockets

SYNOPSIS
       #include	<u.h>

       #include	<libc.h>

       int  sendfd(int socket, int fd)

       int  recvfd(int socket)

DESCRIPTION
       Recvfd  and  sendfd  can	be used	to pass	an open	file descriptor	over a
       Unix domain socket from one process to another.	Since pipe(3)  is  im-
       plemented  with	socketpair(2) instead of pipe(2), socket can be	a file
       descriptor obtained from	pipe(3).

       Sendfd sends the	file descriptor	fd along the socket to a process call-
       ing recvfd on the other end.

       It  is assumed that the two sides have coordinated and agreed to	trans-
       fer a file descriptor already, so that the sendfd is met	with a	recvfd
       instead of an ordinary read.

       The file	descriptor number may change on	its way	between	processes, but
       the kernel structure it represents will not.

SOURCE
       /usr/local/plan9/src/lib9/sendfd.c

SEE ALSO
       socketpair(2), sendmsg in send(2)

								     SENDFD(3)

NAME | SYNOPSIS | DESCRIPTION | SOURCE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=sendfd&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help