Search code examples
cposixlanguage-lawyer

Unmentioned errors in POSIX


opendir is pretty much bound to be a memory-allocating function but the POSIX spec for opendir does not mention ENOMEM in the list of possible errors.

What gives would-be-POSIX-compliant implementations the right to set errno=ENOMEM in a call opendir?


Solution

  • See Error Numbers in System Interfaces: General Information:

    Implementations may support additional errors not included in this list, may generate errors included in this list under circumstances other than those described here, or may contain extensions or limitations that prevent some errors from occurring.