Open System Services Library Calls Reference Manual (G06.28+, H06.05+)

readdir64(3) OSS Library Calls Reference Manual
Use on Objects in /E |
For objects in /E that reside on remote HP NonStop server nodes, the d_ino eld of the dirent64 |
structure contains the Expand node number of the remote HP NonStop server node containing the |
object. The d_ino value for objects in /E that reside on the local node is the pseudo Expand node |
number 255. |
EXAMPLES |
The following example shows how to search a directory for the entry name:|
len = strlen(name);
|
dir_pointer = opendir(".");
|
for (dp = readdir64(dir_pointer); dp != NULL;
|
dp = readdir64(dir_pointer))
|
if (strlen(dp->d_name) == len && !strcmp(dp->d_name, name)) {
|
closedir(dir_pointer);
|
return FOUND;
|
}
|
closedir(dir_pointer);
|
return NOT_FOUND;
|
RETURN VALUES
|
Upon successful completion, the readdir64() function returns a pointer to an object of type |
struct dirent64. When an error is encountered, a null pointer is returned and errno is set to indi- |
cate the error. When the end of the directory is encountered, a null pointer is returned and errno |
is not changed. |
For Guardian disk volumes and subvolumes (directories with OSS pathnames of the form /G/vol |
and /G/vol/subvol), values returned by the telldir() function are kept in a table. When the table |
containing these values overows, the previous telldir() function value becomes invalid. |
When table overow occurs but the telldir() function has not returned a value, a subsequent call |
to the readdir64() function does not set errno to [EINVAL]. |
ERRORS |
If any of the following conditions occurs, the readdir64() function sets errno to the correspond- |
ing value: |
[EBADF] ||
The dir_pointer parameter does not point to a valid directory structure open for |
reading. This error is returned instead of [EFAULT] if the process has copied |
and altered the structure pointed to by the dir_pointer parameter after the system |
has freed the buffer that contains the structure. |
[EFAULT] ||
The dir_pointer parameter does not point to a valid directory structure open for |
reading. |
[EIN- |
VAL]
Table overow occurred after the last valid telldir() function call for a Guardian |
disk volume or subvolume. Only the last 128 values returned by the telldir() |
function can be saved in the table. |
[EIO] ||
An I/O error occurred during a read from the directory. |
576 Hewlett-Packard Company 527187-007