Requirements Catalog of LSB Core 3.1

Requirements for the function 'readdir_r'
StandardIDDescription
SUSv3readdir_r.01 The readdir_r() function shall initialize the dirent structure referenced by entry to represent the directory entry at the current position in the directory stream referred to by dirp, store a pointer to this structure at the location referenced by result, and position the directory stream at the next entry.
SUSv3readdir_r.02 The storage pointed to by entry shall be large enough for a dirent with an array of char d_name members containing at least {NAME_MAX}+1 elements.
SUSv3readdir_r.03 Upon successful return, the pointer returned at *result shall have the same value as the argument entry.
SUSv3readdir_r.04 Upon reaching the end of the directory stream, this pointer shall have the value NULL.
SUSv3readdir_r.05 The readdir_r() function shall not return directory entries containing empty names
SUSv3readdir_r.06 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_r() returns an entry for that file is unspecified.
SUSv3readdir_r.07 The readdir_r() function may buffer several directory entries per actual read operation; the readdir_r() function shall mark for update the st_atime field of the directory each time the directory is actually read
SUSv3readdir_r.09 If successful, the readdir_r() function shall return zero; otherwise, an error number shall be returned to indicate the error.
SUSv3readdir_r.91 The readdir_r() function may fail if:
SUSv3readdir_r.91.01 [EBADF] The dirp argument does not refer to an open directory stream.
The text in the Description column of SUSv3 requirements is reproduced from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html