What does errno 24 (EMFILE) mean?

 
Could be also:
ConstantTypeOS
ERROR_BAD_LENGTHWin32 errorWindows
KERN_MEMORY_DATA_MOVEDKern returnMac
ippStsNoOperationInDllIntel Ipp StatusAny
REFERENCE_BY_POINTERBugCheck CodeWindows
Previous Next
ENFILE ENOTTY

EMFILE

The per-process limit

EMFILE means that this process has reached its file-descriptor ceiling. On Linux, RLIMIT_NOFILE defines one more than the highest descriptor number the process may open. The failure can surface through file open, socket accept, pipe creation, descriptor duplication, or other APIs that allocate a descriptor.

It is frequently caused by a leak: a descriptor is opened on a successful path but not closed on an error, cancellation, or reconnect path. Long-running services can also reach the limit legitimately during bursts if their accepted-connection count, file cache, or worker model has no upper bound.

What to check

  • Measure descriptors by type and owner for the affected process, then compare with its effective resource limit.
  • Audit all close paths, including exceptions, timeouts, failed handshakes, child-process launch, and duplicated descriptors.
  • Use close-on-exec deliberately so unrelated children do not inherit descriptors indefinitely.
  • Increase the limit only after confirming that workload sizing and cleanup are sound; a higher ceiling can merely delay a leak.

References


Looking for a different code? Search another status or error code.