]> git.ozlabs.org Git - ccan/blob - ccan/fdpass/fdpass.h
crypto/shachain/tools: update to new rbuf API.
[ccan] / ccan / fdpass / fdpass.h
1 /* CC0 license (public domain) - see LICENSE file for details */
2 #ifndef CCAN_FDPASS_H
3 #define CCAN_FDPASS_H
4
5 #include <stdbool.h>
6
7 /**
8  * fdpass_send - send a file descriptor across a socket
9  * @sockout: socket to write to
10  * @fd: file descriptor to pass
11  *
12  * On failure, sets errno and returns false.
13  */
14 bool fdpass_send(int sockout, int fd);
15
16 /**
17  * fdpass_recv - receive a file descriptor from a socket
18  * @sockin: socket to read from
19  *
20  * On failure, returns -1 and sets errno.  Otherwise returns fd.
21  */
22 int fdpass_recv(int sockin);
23 #endif /* CCAN_FDPASS_H */