Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
readdir_r(3) OSS Library Calls Reference Manual
When the readdir_r( ) function is called from 64-bit OSS processes, files larger than approxi- |
mately 2 gigabytes are supported. However, for 32-bit OSS processes to access these larger files, |
the application must be compiled using the #define _LARGEFILE64_SOURCE 11 feature test |
macro or an equivalent compiler directive.
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 readdir_r( ) function.
If files are removed from a directory after the most recent call to the opendir( ) or rewinddir( )
function but prior to the first call to the readdir_r( ) function, the readdir_r( ) 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 prior to the first call to the readdir_r( ) function, the
readdir_r( ) function returns entries for these files.
The readdir_r( ) function retrieves a block of directory entries with each actual read operation
and stores them in a system buffer. The readdir_r( ) function marks for update the st_atime
field of the directory each time the directory is actually read.
The first call to the readdir_r( ) 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 readdir_r( ) 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 readdir_r() 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
readdir_r( ) 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 readdir_r( ) 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 readdir_r( ), 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
readdir_r( ) function also returns the . (dot) and ..(dot-dot) entries for each directory that has
been successfully opened.
Use on Objects in /E
For objects in /E that reside on remote HP NonStop server nodes, the d_ino field of the dirent
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
5−148 Hewlett-Packard Company 527187-017