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.
This commit is contained in:
Ben Noordhuis 2013-10-22 12:07:19 +02:00
parent 20edfc76ad
commit 9ab5ee2f39

View File

@ -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);