Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
readdir64(3) OSS Library Calls Reference Manual
NAME
|
readdir64 - Reads a directory stream |
LIBRARY |
G-series native OSS processes: /G/system/sysnn/zossfsrl |
H-series OSS processes: /G/system/zdllnnn/zossfdll |
SYNOPSIS
|
#include <sys/types.h> /* optional except for POSIX.1 */ |
#include <dirent.h> |
struct dirent64 *readdir64( |
DIR *dir_pointer); |
PARAMETERS
|
dir_pointer ||
Points to the dir structure of an open directory. |
DESCRIPTION
|
The readdir64() function is similar to the readdir() function except that, in addition to support- |
ing smaller files, the readdir64() function supports files larger than approximately 2 gigabytes. |
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, which |
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 dir_pointer parameter |
is established by a prior call to the opendir() function. |
The readdir64() function returns a pointer to a structure representing the directory entry at the |
current position in the directory stream specified by the dir_pointer parameter, and then positions |
the directory stream at the next entry. readdir64() returns a null pointer upon reaching the end |
of the directory stream but does not change the value of errno. The dirent64 structure defined in |
the dirent.h header file describes a directory entry. |
The readdir64() function does not return directory entries containing empty names. If entries |
for . (dot) or ..(dot-dot) exist, one entry is returned for . (dot) and one entry is returned for .. |
(dot-dot); otherwise, they are not returned. |
The pointer returned by the readdir64() function points to data that can be overwritten (or data |
that is contained in a buffer that can be freed) by another call to readdir64() on the same direc- |
tory stream. This data is available until another readdir64() or closedir() call is made on the |
same directory stream. |
When one of the set of exec, tdm_exec,ortdm_spawn functions is called, all open directory |
streams are closed automatically. (For calls by tdm_spawn functions, only the directory streams |
of the child process are closed.) The effect is the same as if the closedir() function had been |
called for each open directory stream. |
If the dir_pointer parameter does not refer to a currently opened directory stream when it is |
passed to the readdir64() function, the following can occur: |
|
• ||
The error value [EBADF] or [EFAULT] might be returned. |
5−74 Hewlett-Packard Company 527187-007