Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (n - r) readdir64_r(3)
NAME
readdir64_r - Reads a directory stream (reentrant)
LIBRARY
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zossfdll |
SYNOPSIS
[#include <sys/types.h>]
#include <dirent.h>
int readdir64_r(
DIR *dirp,
struct dirent64 *ret,
struct dirent64 **result);
PARAMETERS
dirp Points to the dirent64 structure of an open directory.
ret Points to the directory entry at the current position in the directory stream.
result Points to the struct dirent64 structure where the returned directory entry is
stored.
DESCRIPTION
The readdir64_r( ) function is the reentrant version of the readdir64() function. Similar to the |
readdir64_r( ) function, calls to the readdir64_r( ) function are redirected to the readdir_r( ) |
function for 64-bit applications. This function is supported on systems running H06.21 and later
H-series RVUs and J06.10 and later J-series RVUs only.
An application can explicitly call this function when you compile the application using the
#define _LARGEFILE64_SOURCE 1 feature test macro or an equivalent compiler command
option.
An application call to readdir( ) is automatically mapped to this function when you compile the
application using the #define _FILE_OFFSET_BITS 64 feature test macro or an equivalent
compiler command option.
The type DIR, which is defined in the dirent.h header file, represents a directory stream. A
directory stream is an ordered sequence of all the directory entries in a particular directory.
(Directory streams are not implemented through file descriptors.) The structure pointed to by the
dirp parameter is established by a prior call to the opendir( ) function.
The readdir64_r( ) function initializes the dirent64 structure referenced by the ret parameter to
represent the directory entry at the current position in the directory stream referred to by the dirp
parameter, stores a pointer to this structure at the location referenced by the result parameter, and
positions the directory stream at the next entry.
The storage pointed to by ret is large enough for a dirent64 with an array of char d_name
member containing at least NAME_MAX plus one element.
Upon successful return, the pointer returned at *result has the same value as the value passed by
ret. Upon reaching the end of the directory stream, this pointer has the value NULL.
The readdir64_r( ) function does not return directory entries containing empty names. It is
unspecified whether entries are returned for the . (dot) or .. (dot-dot) directories.
If a file is removed from or added to the directory after the most recent call to the opendir( ) or
rewinddir( ) function, it is unspecified whether a subsequent call to readdir64_r( ) returns an
entry for that file.
The readdir64_r( ) function might buffer several directory entries per actual read operation; the
readdir64_r( ) function marks for update the st_atime field of the directory each time the
527187-017 Hewlett-Packard Company 5−145