| Previous | Next |
| EPROCUNAVAIL | ENOLCK |
EBADFD
EBADFD is more state-oriented than EBADF. EBADF normally says that the file descriptor number is invalid for the process or not open in the required direction. EBADFD indicates that the descriptor object exists but is in a bad state for the operation being attempted.
This distinction matters in asynchronous code. A descriptor can still be a live integer while the underlying object has transitioned through shutdown, connect, accept, close, detach, or protocol-specific teardown. Logging only the numeric descriptor loses the state that explains the error.
Useful state to capture
- The descriptor owner, creation site, and current object type.
- Recent state transitions such as connect-in-progress, accepted, shutdown, closed, or detached.
- Outstanding event-loop registrations and pending callbacks.
- Whether another thread can close or repurpose the descriptor while work is queued.
Linux errno(3) · Linux UAPI errno definitions
Looking for a different code? Search another status or error code.