Go to the documentation of this file.
33 #include <sys/socket.h>
47 r = ioctlsocket(sock, FIONBIO, &on);
50 int flags = fcntl(sock, F_GETFL, 0);
52 r = fcntl(sock, F_SETFL,
flags | O_NONBLOCK);
105 #if defined(NO_SEND_HANDLE_ON_PIPE)
114 struct cmsghdr *cmsg;
118 ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, fds));
120 ASSERT(0 == socketpair(AF_UNIX, SOCK_STREAM, 0, send_fds +
i));
132 msg.msg_controllen = CMSG_LEN(
sizeof(send_fds));
135 cmsg = CMSG_FIRSTHDR(&
msg);
136 cmsg->cmsg_level = SOL_SOCKET;
137 cmsg->cmsg_type = SCM_RIGHTS;
138 cmsg->cmsg_len =
msg.msg_controllen;
142 void* pv = CMSG_DATA(cmsg);
152 r = sendmsg(fds[0], &
msg, 0);
153 while (
r == -1 && errno == EINTR);
static void alloc_cb(uv_handle_t *handle, size_t size, uv_buf_t *buf)
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t *handle)
static uv_pipe_t incoming[4]
#define ARRAY_SIZE(array)
return memset(p, 0, total)
UV_EXTERN int uv_pipe_init(uv_loop_t *, uv_pipe_t *handle, int ipc)
static void close_cb(uv_handle_t *handle)
static void set_nonblocking(uv_os_sock_t sock)
static void read_cb(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
UV_EXTERN uv_loop_t * uv_default_loop(void)
static unsigned int close_called
UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
UV_EXTERN int uv_accept(uv_stream_t *server, uv_stream_t *client)
#define MAKE_VALGRIND_HAPPY()
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle)
UV_EXTERN uv_buf_t uv_buf_init(char *base, unsigned int len)
#define RETURN_SKIP(explanation)
UV_EXTERN int uv_read_stop(uv_stream_t *)
UV_EXTERN int uv_pipe_open(uv_pipe_t *, uv_file file)
static unsigned int incoming_count
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:30