2026-01-15 08:24:08 +02:00
|
|
|
#ifndef _CH_PROXY_SENFD
|
|
|
|
|
#define _CH_PROXY_SENFD
|
|
|
|
|
|
2026-01-22 14:29:45 +02:00
|
|
|
#include <stddef.h> /* size_t */
|
|
|
|
|
#include <sys/types.h> /* ssize_t */
|
|
|
|
|
#include <sys/uio.h> /* iovec */
|
2026-01-15 08:24:08 +02:00
|
|
|
|
|
|
|
|
|
2026-01-28 07:04:57 +02:00
|
|
|
/* send_fd(chanFd, fd, *iov)
|
|
|
|
|
*
|
|
|
|
|
* chanFd: fd to sendmsg over;
|
|
|
|
|
* fd: fd to send;
|
|
|
|
|
* iov: extra data to send or NULL;
|
|
|
|
|
*
|
|
|
|
|
* returns: result of sendmsg,
|
|
|
|
|
* i.e. the number of bytes sent */
|
|
|
|
|
ssize_t send_fd(int chanFd, int fd, const struct iovec *);
|
|
|
|
|
|
|
|
|
|
/* recv_fd(chanFd, flags)
|
|
|
|
|
*
|
|
|
|
|
* chanFd: fd to recvmsg from;
|
|
|
|
|
* flags: recvmsg flags e.g. 0, or MSG_CMSG_CLOEXEC?
|
|
|
|
|
*
|
|
|
|
|
* returns: the received fd or -1 */
|
|
|
|
|
int recv_fd(int chanFd, int flags);
|
2026-01-15 08:24:08 +02:00
|
|
|
|
2026-01-28 07:04:57 +02:00
|
|
|
#endif /* _CH_PROXY_SENFD */
|