From 9ab5ee2f398b133e39e85aaf8a7788977ea9aa8d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 22 Oct 2013 12:07:19 +0200 Subject: [PATCH] include: document pipe path truncation behavior Document the fact that the maximum path length for UNIX domain socket paths is much less than _POSIX_PATH_MAX. For most file systems, _POSIX_PATH_MAX is 1024 or 4096 bytes while `sizeof(sockaddr_un.sun_path)` is typically between 92 and 108 bytes. --- include/uv.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/uv.h b/include/uv.h index a09b07e2..5a1d1d94 100644 --- a/include/uv.h +++ b/include/uv.h @@ -1118,8 +1118,20 @@ UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc); */ UV_EXTERN int uv_pipe_open(uv_pipe_t*, uv_file file); +/* + * Bind the pipe to a file path (UNIX) or a name (Windows.) + * + * Paths on UNIX get truncated to `sizeof(sockaddr_un.sun_path)` bytes, + * typically between 92 and 108 bytes. + */ UV_EXTERN int uv_pipe_bind(uv_pipe_t* handle, const char* name); +/* + * Connect to the UNIX domain socket or the named pipe. + * + * Paths on UNIX get truncated to `sizeof(sockaddr_un.sun_path)` bytes, + * typically between 92 and 108 bytes. + */ UV_EXTERN void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle, const char* name, uv_connect_cb cb);