从man bind
ENOTSOCK // sockfd is a descriptor for a file, not a socket. The following errors are specific to UNIX domain (AF_UNIX) sockets:
EFAULT // addr points outside the user's accessible address space.
ELOOP // Too many symbolic links were encountered in resolving addr.
ENOENT // The file does not exist.
ENOTDIR // A component of the path prefix is not a directory.
EROFS// The socket inode would reside on a read-only file system.
尤其是当ELOOP,ENOENT,ENOTDIR,EROFS发生时我无法理解。这是否与某些特殊文件系统有关,如nfs等等?
答案 0 :(得分:4)
请记住,套接字和bind
不仅可用于网络通信。请参阅示例Unix domain sockets,它们被绑定为文件系统中的文件。
它甚至出现在你自己引用的错误列表中:
以下错误特定于UNIX域(AF_UNIX)套接字