C语言 EAGAIN 是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4058368/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 06:51:33 来源:igfitidea点击:
What does EAGAIN mean?
提问by David van Dugteren
As in the title what does EAGAIN mean?
正如标题中的 EAGAIN 是什么意思?
回答by Frédéric Hamidi
回答by turfx
Using man 2 intro | less -Ip EAGAIN:
使用man 2 intro | less -Ip EAGAIN:
35 EAGAIN Resource temporarily unavailable. This is a temporary condi-
tion and later calls to the same routine may complete normally.
回答by wildplasser
What it means is less important. What it implies:
这意味着什么并不重要。它的含义:
- your system call failed
- nothing happened (system calls are atomic, and this one just did not happen)
- you couldtry it again (it could fail again, possibly with a different result)
- or you couldchoose otherwise.
- 你的系统调用失败
- 什么也没发生(系统调用是原子的,而这个只是没有发生)
- 你可以再试一次(它可能会再次失败,可能会有不同的结果)
- 或者你可以选择其他方式。
The whole thing about EAGAINis that your process is not blocked inside the system call; it has the right to choose: either retry or do something useful.
整件事EAGAIN是你的进程没有被系统调用阻塞;它有权选择:要么重试,要么做一些有用的事情。

