0

错误取自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 等)有关?

4

1 回答 1

4

请记住,套接字bind并不仅仅可以用于网络通信。例如,请参阅作为文件绑定在文件系统中的文件的Unix 域套接字。

它甚至在您自己引用的错误列表中:

以下错误特定于 UNIX 域 (AF_UNIX) 套接字

于 2013-08-07T10:42:43.420 回答