Requirements Catalog of LSB Core 3.1
Requirements for the function 'opendir'
| Standard | ID | Description |
| SUSv3 | app.opendir.01 | The opendir() function shall open a directory stream corresponding to the directory named by the dirname argument. |
| SUSv3 | opendir.02 | The directory stream is positioned at the first entry. |
| SUSv3 | opendir.03 | If the type DIR is implemented using a file descriptor, applications shall only be able to open up to a total of {OPEN_MAX} files and directories. |
| SUSv3 | opendir.04 | Upon successful completion, opendir() shall return a pointer to an object of type DIR. |
| SUSv3 | opendir.05 | Otherwise, a null pointer shall be returned and errno set to indicate the error. |
| SUSv3 | opendir.06 | The opendir() function shall fail if: |
| SUSv3 | opendir.06.01 | [EACCES] Search permission is denied for the component of the path prefix of dirname or read permission is denied for dirname. |
| SUSv3 | opendir.06.02 | [ELOOP] A loop exists in symbolic links encountered during resolution of the dirname argument. |
| SUSv3 | opendir.06.03 | [ENAMETOOLONG] The length of the dirname argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. |
| SUSv3 | opendir.06.04 | [ENOENT] A component of dirname does not name an existing directory or dirname is an empty string. |
| SUSv3 | opendir.06.05 | [ENOTDIR] A component of dirname is not a directory. |
| SUSv3 | opendir.07 | The opendir() function may fail if: |
| SUSv3 | opendir.07.01 | [ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the dirname argument. |
| SUSv3 | opendir.07.02 | [EMFILE] {OPEN_MAX} file descriptors are currently open in the calling process. |
| SUSv3 | opendir.07.03 | [ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the dirname argument, the length of the substituted pathname string exceeded {PATH_MAX}. |
| SUSv3 | opendir.07.04 | [ENFILE] Too many files are currently open in the system. |