bind() 错误,errno == ENOENT?
任何人都可以帮助解释当bind()套接字函数失败时ENOENT的errno值意味着什么?手册页说这意味着“该文件不存在”。什么文件?我尝试使用错误的文件描述符调用bind(),并将 errno 按预期设置为 EBADF,所以事实并非如此。
Can anyone help explain what an errno value of ENOENT means when the bind() socket function fails? The man page says this means "the file does not exist". What file? I tried calling bind() with a bad file descriptor and that sets errno to EBADF as expected, so it's not that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这几乎肯定是您的代码中的错误。如果我必须猜测(我确实这么做了),我会说您传递给绑定的地址中有一个错误的 UNIX 套接字路径。
错误代码也可能不是来自绑定 - 检查您的线程安全性。
This is almost certainly a bug in your code. If I had to guess, which I do, I'd say you've got a bad UNIX socket path in the address you pass to bind.
It is also possible that the error code isn't coming from bind - check your thread safety.