David van Dugteren
David van Dugteren

Reputation: 4109

What does EAGAIN mean?

As in the title what does EAGAIN mean?

Upvotes: 92

Views: 112053

Answers (5)

douyu
douyu

Reputation: 2599

Excerpt errno(3) - Linux manual page:

EAGAIN Resource temporarily unavailable (may be the same value as EWOULDBLOCK) (POSIX.1-2001).

Use case: When epoll in ET mode, only wait after read or write return EAGAIN

Upvotes: 0

wildplasser
wildplasser

Reputation: 44250

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 could try it again (it could fail again, possibly with a different result)
  • or you could choose otherwise.

The whole thing about EAGAIN is that your process is not blocked inside the system call; it has the right to choose: either retry or do something useful.

Upvotes: 7

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

EAGAIN is often raised when performing non-blocking I/O. It means "there is no data available right now, try again later".

It might (or might not) be the same as EWOULDBLOCK, which means "your thread would have to block in order to do that".

Upvotes: 101

turfx
turfx

Reputation: 291

Using 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.

Upvotes: 29

thelost
thelost

Reputation: 6694

According to this, it means "Operation would have caused the process to be suspended."

Upvotes: -1

Related Questions