Go to the documentation of this file.
35 handle->shutdown_req = NULL;
36 handle->connect_req = NULL;
44 struct sockaddr_un saddr;
45 const char* pipe_fname;
57 if (pipe_fname == NULL)
68 memset(&saddr, 0,
sizeof saddr);
69 uv__strscpy(saddr.sun_path, pipe_fname,
sizeof(saddr.sun_path));
70 saddr.sun_family = AF_UNIX;
72 if (bind(sockfd, (
struct sockaddr*)&saddr,
sizeof saddr)) {
84 handle->pipe_fname = pipe_fname;
85 handle->io_watcher.fd = sockfd;
101 #if defined(__MVS__) || defined(__PASE__)
106 else if (backlog < 0)
130 handle->pipe_fname = NULL;
147 mode = fcntl(fd, F_GETFL);
148 while (
mode == -1 && errno == EINTR);
157 #if defined(__APPLE__)
164 if (
mode != O_WRONLY)
166 if (
mode != O_RDONLY)
177 struct sockaddr_un saddr;
191 memset(&saddr, 0,
sizeof saddr);
193 saddr.sun_family = AF_UNIX;
197 (
struct sockaddr*)&saddr,
sizeof saddr);
199 while (
r == -1 && errno == EINTR);
201 if (
r == -1 && errno != EINPROGRESS) {
203 #if defined(__CYGWIN__) || defined(__MSYS__)
244 struct sockaddr_un sa;
248 addrlen =
sizeof(sa);
252 (
struct sockaddr*) &sa,
259 #if defined(__linux__)
260 if (sa.sun_path[0] == 0)
262 addrlen -= offsetof(
struct sockaddr_un, sun_path);
265 addrlen = strlen(sa.sun_path);
268 if ((
size_t)addrlen >= *
size) {
304 if (
handle->accepted_fd == -1)
307 if (
handle->queued_fds == NULL)
310 queued_fds =
handle->queued_fds;
311 return queued_fds->
offset + 1;
319 if (
handle->accepted_fd == -1)
327 unsigned desired_mode;
328 struct stat pipe_stat;
348 if (name_buffer == NULL)
358 if (
stat(name_buffer, &pipe_stat) == -1) {
365 desired_mode |= S_IRUSR | S_IRGRP | S_IROTH;
367 desired_mode |= S_IWUSR | S_IWGRP | S_IWOTH;
370 if ((pipe_stat.st_mode & desired_mode) == desired_mode) {
375 pipe_stat.st_mode |= desired_mode;
377 r = chmod(name_buffer, pipe_stat.st_mode);
380 return r != -1 ? 0 :
UV__ERR(errno);
void uv__stream_close(uv_stream_t *handle)
void uv__pipe_close(uv_pipe_t *handle)
return memset(p, 0, total)
int uv__socket(int domain, int type, int protocol)
#define uv__req_init(loop, req, typ)
void * uv__malloc(size_t size)
static int uv__pipe_getsockpeername(const uv_pipe_t *handle, uv__peersockfunc func, char *buffer, size_t *size)
int uv_pipe_listen(uv_pipe_t *handle, int backlog, uv_connection_cb cb)
UV_REQ_FIELDS uv_connect_cb cb
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void uv__server_io(uv_loop_t *loop, uv__io_t *w, unsigned int events)
void uv_pipe_pending_instances(uv_pipe_t *handle, int count)
int uv__fd_exists(uv_loop_t *loop, int fd)
char * uv__strdup(const char *s)
void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events)
int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, struct sockaddr *name, int *namelen)
int uv_pipe_init(uv_loop_t *loop, uv_pipe_t *handle, int ipc)
int uv_pipe_getsockname(const uv_pipe_t *handle, char *buffer, size_t *size)
int uv_pipe_open(uv_pipe_t *handle, uv_file fd)
void uv__stream_init(uv_loop_t *loop, uv_stream_t *stream, uv_handle_type type)
uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle)
void(* uv_connect_cb)(uv_connect_t *req, int status)
int uv_pipe_bind(uv_pipe_t *handle, const char *name)
void uv_pipe_connect(uv_connect_t *req, uv_pipe_t *handle, const char *name, uv_connect_cb cb)
ssize_t uv__strscpy(char *d, const char *s, size_t n)
void uv__io_feed(uv_loop_t *loop, uv__io_t *w)
int uv_pipe_pending_count(uv_pipe_t *handle)
def listen(endpoint, test_case)
int(* uv__peersockfunc)(int, struct sockaddr *, socklen_t *)
void(* uv_connection_cb)(uv_stream_t *server, int status)
#define uv__stream_fd(handle)
uv_handle_type uv__handle_type(int fd)
int uv_pipe_getpeername(const uv_pipe_t *handle, char *buffer, size_t *size)
int uv__stream_open(uv_stream_t *, int fd, int flags)
OPENSSL_EXPORT pem_password_cb * cb
int uv_pipe_chmod(uv_pipe_t *handle, int mode)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:52