| Previous | Next |
| EAGAIN | ENOMEM |
EAGAIN
EAGAIN is one of the ordinary C runtime values in the Windows UCRT header. Its useful meaning is not “retry every failure”: it marks a condition that may change without altering the request, such as a temporary resource limit or a nonblocking-style availability boundary exposed by a portability layer.
On Windows, keep the error channel intact. A CRT function may set errno, a Win32 function normally reports failure through its documented return value and GetLastError(), and a Winsock function reports a WSAE* value through WSAGetLastError(). In particular, EAGAIN is not the numeric value of WSAEWOULDBLOCK.
How to handle a retryable result
- Record the exact failing function, its return value, the thread, and the captured error value before making another CRT, Win32, or Winsock call.
- Retry only when that API documents retry or readiness semantics. A tight retry loop can turn a transient shortage into CPU pressure.
- For socket code, wait for the relevant readiness or completion notification rather than treating a generic
errnovalue as a Winsock status. - Bound retries by time or attempt count and preserve the first failure that started the retry sequence.
References
Looking for a different code? Search another status or error code.