问题描述
是否有约定将表示端点的文件"放置到Unix域套接字?
Is there a convention where to place the 'files' representing the end points to Unix Domain Sockets?
我倾向于将它们放到/tmp/some-application-specific-subdir-name/
,但是我想知道是否还有更常见的地方.
I tend to put them to /tmp/some-application-specific-subdir-name/
, but I wonder if there is a more common place.
背景是, POSIX 不清楚关于访问这样的文件"的最大路径长度:
The background is, that POSIX is not clear about the maximum path length to access such 'files':
应用程序不应假定sun_path的特定长度,也不能假定它可以容纳{_POSIX_PATH_MAX}个字节(256).
Applications should not assume a particular length for sun_path or assume that it can hold {_POSIX_PATH_MAX} bytes (256).
因此,应将路径长度的这种限制"排除在应用程序的文件/路径名称配置之外.
So this "restriction" on the path's length should be kept out of the application's file/path name configurations.
推荐答案
(它以前是 /var/run
.)
(It used to be /var/run
.)
这篇关于Unix域(AF_UNIX)套接字的端点(文件)放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!