gpt4 book ai didi

sockets - 在哪里放置 Unix 域 (AF_UNIX) 套接字的端点(文件)?

转载 作者:行者123 更新时间:2023-12-02 09:52:13 25 4
gpt4 key购买 nike

是否有约定将代表 Unix 域套接字端点的"file"放置在何处?

我倾向于将它们放在 /tmp/some-application-specific-subdir-name/ 中,但我想知道是否有更常见的地方。

背景是,POSIX不清楚访问此类"file"的最大路径长度:

The size of sun_path has intentionally been left undefined. This is because different implementations use different sizes. For example, 4.3 BSD uses a size of 108, and 4.4 BSD uses a size of 104. Since most implementations originate from BSD versions, the size is typically in the range 92 to 108.

Applications should not assume a particular length for sun_path or assume that it can hold {_POSIX_PATH_MAX} bytes (256).

因此,这种对路径长度的“限制”应该保留在应用程序的文件/路径名配置之外。

最佳答案

FHS说:/run

(以前是 /var/run 。)

关于sockets - 在哪里放置 Unix 域 (AF_UNIX) 套接字的端点(文件)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7580346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com