Open System Services Library Calls Reference Manual (G06.28+, H06.05+)
OSS Library Calls (n - r) readdir64(3)
|
• ||
The caller might receive a SIGSEGV or SIGILL signal in the OSS environment. |
|
• ||
The caller might cause a trap condition in the Guardian environment. |
|
• ||
User memory might be corrupted. |
General Considerations for Directory Operations |
Directory entries represent files. Files can be removed from a directory or added to a directory |
asynchronously to the operation of the readdir64() function. |
If files are removed from a directory after the most recent call to the opendir() or rewinddir() |
function but before the first call to the readdir64() function, the readdir64() function does not |
return entries for these files. If files are added to a directory after the most recent call to the |
opendir( ) or rewinddir( ) function but before the first call to the readdir64() function, the read- |
dir64() function returns entries for these files. |
The readdir64() function retrieves a block of directory entries with each actual read operation |
and stores them in a system buffer. The readdir64() function marks for update the st_atime |
field of the directory each time the directory is actually read. |
The first call to the readdir64() function after a call to the opendir( ) or rewinddir() function |
retrieves a block of directory entries. The first two entries of the block are for . (dot) and ..(dot- |
dot). Therefore, the first entry returned is for . (dot). Each subsequent call to readdir64() fetches |
another entry from the buffer until the buffer is empty, at which time another block of entries is |
automatically retrieved. |
If files are added to a directory after a block of entries has been fetched for a readdir64() call, no |
entries are returned for those files. If files are deleted after a block of entries has been fetched, |
entries are returned for those files. |
Directory Operations After fork Operations |
If, after a call to the fork() or tdm_fork() function, both the parent and child processes call the |
readdir64() function to access an OSS directory, the results of the calls are undefined. |
If, after a call to the fork() or tdm_fork( ) function, both the parent and child processes call the |
rewinddir( ) function and the readdir64() function to access an OSS directory, the results are |
undefined. |
Use on Guardian Objects |
Only disks appear as entries in the /G directory. |
A call to opendir() on /G, followed by calls to readdir64(), returns all of the Guardian volumes |
on the system. |
The same sequence performed on /G/vol returns all of the subvolumes and temporary files on that |
particular volume. |
The same sequence performed on /G/vol/subvol returns all of the files on that particular subvo- |
lume, including files that are inaccessible to the OSS interface such as Enscribe structured files |
and SQL objects. |
The OSS pathnames (relative to /G) returned for Guardian files are in lowercase. The read- |
dir64() function also returns the . (dot) and ..(dot-dot) entries for each directory that has been |
successfully opened. |
527187-007 Hewlett-Packard Company 5−75