What does errno 36 (ENAMETOOLONG) mean?

 
Could be also:
ConstantTypeOS
ERROR_SHARING_BUFFER_EXCEEDEDWin32 errorWindows
KERN_NOT_DEPRESSEDKern returnMac
ippStsNotSupportedCpuIntel Ipp StatusAny
EINPROGRESSerrnoMac
EIDRMerrnoSolaris
EDEADLKerrnoWindows
NTFS_FILE_SYSTEMBugCheck CodeWindows
Previous Next
EDEADLK ENOLCK

ENAMETOOLONG

Component limits and whole-path limits

ENAMETOOLONG can describe two different limits. A single filename component may be longer than the filesystem accepts, or the complete pathname supplied to an interface may exceed its accepted length while the kernel is resolving directories and symbolic links. A path assembled from prefixes, user input, build output, archive extraction, or nested mount points can hit the second limit even when every visible filename looks reasonable.

Do not assume that one compile-time PATH_MAX value describes every filesystem and every operation. Portable code should query limits where appropriate and should avoid constructing unbounded path strings. Symlink expansion and repeated path joining are frequent sources of unexpectedly long names.

How to investigate

  • Log the original path, its byte length, and the lengths of individual components without truncating diagnostic output.
  • Check whether a generated prefix, cache key, archive member, or repeated directory join is responsible.
  • Use directory file descriptors and *at() APIs to avoid repeatedly concatenating long absolute paths.
  • Shorten deterministic generated names with a collision-resistant mapping rather than simply cutting suffixes off.

References


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