1io_passfd(3) Library Functions Manual io_passfd(3)
2
3
4
6 io_passfd - pass a file descriptor over a Unix Domain socket
7
9 #include <io.h>
10
11 int io_passfd(int64 sock,int64 fd);
12
14 io_passfd transfers the file descriptor fd over the Unix Domain socket
15 sock. This works much like dup(2), only that the copy of the descrip‐
16 tor appears not in this process but at the other end of the Unix Domain
17 socket (which therefore must be a process on the same system).
18
19 The peer can then use io_receivefd(3) to receive the file descriptor.
20
21 Note that the passed descriptor stays open in the sending process.
22
24 io_passfd returns 0 on success, -1 on error (setting errno accord‐
25 ingly).
26
28 io_receivefd(3)
29
30
31
32 io_passfd(3)