Каталог требований LSB Core 3.1
Требования для функции 'readdir'
| Standard | ID | Description |
| SUSv3 | readdir.01 | The readdir() function shall return a pointer to a structure representing the directory entry at the current position in the directory stream specified by the argument dirp, and position the directory stream at the next entry. |
| SUSv3 | readdir.01.01 | Upon successful completion, readdir() shall return a pointer to an object of type struct dirent |
| SUSv3 | readdir.02 | It shall return a null pointer upon reaching the end of the directory stream. |
| SUSv3 | readdir.02.01 | When the end of the directory is encountered, a null pointer shall be returned and errno is not changed |
| SUSv3 | readdir.03 | The readdir() function shall not return directory entries containing empty names |
| SUSv3 | readdir.04 | If entries for dot or dot-dot exist, one entry shall be returned for dot and one entry shall be returned for dot-dot; otherwise, they shall not be returned |
| SUSv3 | app.readdir.05 | The pointer returned by readdir() points to data which may be overwritten by another call to readdir() on the same directory stream. |
| SUSv3 | app.readdir.06 | This data is not overwritten by another call to readdir() on a different directory stream. |
| SUSv3 | readdir.07 | If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir() returns an entry for that file is unspecified. |
| SUSv3 | readdir.08 | The readdir() function may buffer several directory entries per actual read operation; |
| SUSv3 | readdir.09 | readdir() shall mark for update the st_atime field of the directory each time the directory is actually read. |
| SUSv3 | app.readdir.10 | After a call to fork(), either the parent or child (but not both) may continue processing the directory stream using readdir(), rewinddir(), [XSI] or seekdir(). |
| SUSv3 | app.readdir.11 | If both the parent and child processes use these functions, the result is undefined. |
| SUSv3 | readdir.12 | If the entry names a symbolic link, the value of the d_ino member is unspecified |
| SUSv3 | app.readdir.13 | The readdir() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe. |
| SUSv3 | readdir.16 | Applications wishing to check for error situations should set errno to 0 before calling readdir(). If errno is set to non-zero on return, an error occurred. |
| SUSv3 | readdir.16.01 | When an error is encountered, a null pointer shall be returned and errno shall be set to indicate the error. |
| SUSv3 | readdir.90 | The readdir() function shall fail if: |
| SUSv3 | readdir.90.01 | [EOVERFLOW] One of the values in the structure to be returned cannot be represented correctly. |
| SUSv3 | readdir.91 | The readdir() function may fail if: |
| SUSv3 | readdir.91.01 | [EBADF] The dirp argument does not refer to an open directory stream. |
| SUSv3 | readdir.91.02 | [ENOENT] The current position of the directory stream is invalid. |