| Previous | Next |
| EDEADLK | ENOMSG |
EAGAIN
A readiness result, not proof that the peer failed
EAGAIN commonly appears when an operation is intentionally non-blocking and no immediate progress is possible. On a writable socket or pipe, this can mean flow control has stopped the current write; on other APIs it can indicate a transient resource condition. The call has not completed, so the application must preserve the exact unsent or unread state.
A busy retry loop is usually the wrong response. Wait for the readiness or completion mechanism associated with the descriptor, then resume from the byte or message boundary actually reported by the preceding call. Treat this result differently from ETIMEDOUT: the former says “not now,” while the latter says the caller’s deadline elapsed.
What makes the diagnosis actionable
- Log whether the descriptor is non-blocking, the requested and completed byte counts, and the event source used to resume work.
- For writes, retain the unwritten suffix rather than resending the whole buffer.
- Measure queue depth and time spent waiting; repeated this result can expose a missing consumer or a backpressure policy problem.
References
- Apple XNU: Darwin errno definitions
- Apple write(2): non-blocking write behavior
- Apple system-call reference: EAGAIN
Looking for a different code? Search another status or error code.