#include "uv.h"
#include "internal.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <sys/un.h>
#include <unistd.h>
#include <stdlib.h>
Go to the source code of this file.
|
int | uv_pipe_init (uv_loop_t *loop, uv_pipe_t *handle, int ipc) |
|
int | uv_pipe_bind (uv_pipe_t *handle, const char *name) |
|
int | uv_pipe_listen (uv_pipe_t *handle, int backlog, uv_connection_cb cb) |
|
void | uv__pipe_close (uv_pipe_t *handle) |
|
int | uv_pipe_open (uv_pipe_t *handle, uv_file fd) |
|
void | uv_pipe_connect (uv_connect_t *req, uv_pipe_t *handle, const char *name, uv_connect_cb cb) |
|
static int | uv__pipe_getsockpeername (const uv_pipe_t *handle, uv__peersockfunc func, char *buffer, size_t *size) |
|
int | uv_pipe_getsockname (const uv_pipe_t *handle, char *buffer, size_t *size) |
|
int | uv_pipe_getpeername (const uv_pipe_t *handle, char *buffer, size_t *size) |
|
void | uv_pipe_pending_instances (uv_pipe_t *handle, int count) |
|
int | uv_pipe_pending_count (uv_pipe_t *handle) |
|
uv_handle_type | uv_pipe_pending_type (uv_pipe_t *handle) |
|
int | uv_pipe_chmod (uv_pipe_t *handle, int mode) |
|
◆ uv__pipe_close()
◆ uv__pipe_getsockpeername()
Definition at line 240 of file pipe.c.
259 #if defined(__linux__)
260 if (sa.sun_path[0] == 0)
#define offsetof(type, member)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static const void static count static fd struct stat static buf struct pollfd unsigned static timeout void static offset void static length char static len const struct iovec static count unsigned long static filedes static sched_yield static flags static oldfd static pause unsigned static seconds static protocol struct sockaddr addrlen
int uv__getsockpeername(const uv_handle_t *handle, uv__peersockfunc func, struct sockaddr *name, int *namelen)
References addrlen, err, handle, memcpy(), memset(), offsetof, sockaddr_un::sun_path, and uv__getsockpeername().
Referenced by uv_pipe_getpeername(), and uv_pipe_getsockname().
◆ uv_pipe_bind()
Definition at line 43 of file pipe.c.
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));
84 handle->pipe_fname = pipe_fname;
ssize_t uv__strscpy(char *d, const char *s, size_t n)
int uv__socket(int domain, int type, int protocol)
#define uv__stream_fd(handle)
char * uv__strdup(const char *s)
◆ uv_pipe_chmod()
Definition at line 326 of file pipe.c.
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);
static static fork const void static count static fd const char const char static newpath const char static path chmod
int uv_pipe_getsockname(const uv_pipe_t *handle, char *buffer, size_t *size)
void * uv__malloc(size_t size)
◆ uv_pipe_connect()
Definition at line 173 of file pipe.c.
191 memset(&saddr, 0,
sizeof saddr);
197 (
struct sockaddr*)&saddr,
sizeof saddr);
199 while (
r == -1 && errno ==
EINTR);
203 #if defined(__CYGWIN__) || defined(__MSYS__)
const lzma_allocator const uint8_t size_t uint8_t * out
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events)
void uv__io_feed(uv_loop_t *loop, uv__io_t *w)
int uv__stream_open(uv_stream_t *, int fd, int flags)
#define uv__req_init(loop, req, typ)
◆ uv_pipe_getpeername()
Definition at line 289 of file pipe.c.
static int uv__pipe_getsockpeername(const uv_pipe_t *handle, uv__peersockfunc func, char *buffer, size_t *size)
◆ uv_pipe_getsockname()
◆ uv_pipe_init()
Definition at line 33 of file pipe.c.
void uv__stream_init(uv_loop_t *loop, uv_stream_t *stream, uv_handle_type type)
◆ uv_pipe_listen()
Definition at line 94 of file pipe.c.
101 #if defined(__MVS__) || defined(__PASE__)
106 else if (backlog < 0)
static struct sockaddr static addrlen listen
void uv__server_io(uv_loop_t *loop, uv__io_t *w, unsigned int events)
◆ uv_pipe_open()
Definition at line 137 of file pipe.c.
157 #if defined(__APPLE__)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags fcntl
static struct sockaddr static addrlen static backlog const void static flags void flags
int uv__fd_exists(uv_loop_t *loop, int fd)
static const z80_opcode fd[]
◆ uv_pipe_pending_count()
Definition at line 298 of file pipe.c.
304 if (
handle->accepted_fd == -1)
310 queued_fds =
handle->queued_fds;
311 return queued_fds->
offset + 1;
◆ uv_pipe_pending_instances()
void uv_pipe_pending_instances |
( |
uv_pipe_t * |
handle, |
|
|
int |
count |
|
) |
| |
◆ uv_pipe_pending_type()
Definition at line 315 of file pipe.c.
319 if (
handle->accepted_fd == -1)
uv_handle_type uv__handle_type(int fd)