Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (n - r) rewinddir(3)
If, after a call to a fork( ) or tdm_fork( ) function, both the parent and child processes make calls
to the rewinddir( ) function and the readdir() 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 rewinddir( ) rewinds the list of
disks to the beginning. A call to rewinddir( ) on a specific disk rewinds the list of its
subvolumes to the beginning.
RETURN VALUES
The rewinddir( ) function does not return a value. If rewinddir( ) detects a problem, it sets
errno. For correct processing of errors, set errno to the value 0 (zero) before each rewinddir( )
function call and test the value of errno after each call.
ERRORS
If any of the following conditions occur, the rewinddir( ) function sets errno to the correspond-
ing value:
[EBADF] The dir_pointer parameter does not refer to an open directory stream. This error
is returned instead of [EFAULT] if the process has copied and altered the struc-
ture 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.
RELATED INFORMATION
Functions: closedir(3), mkdir(2), opendir(3), readdir(3), rmdir(2), seekdir(3), telldir(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. The following
features are affected in the HP implementation:
• 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( ) function, the readdir()
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( ) function, the readdir( ) function returns entries for these files.
• The ramifications of buffering more than one directory entry per read operation are
defined.
• After a call to one of the exec set of functions, all open directory streams are closed
automatically.
• The ramifications of having both the parent and child processes access the same OSS
directory after a call to the fork( ) or tdm_fork( ) function are undefined.
• The consequences of calling directory functions with a dir_pointer parameter that does
not refer to a currently opened directory stream are defined. (The error value [EBADF]
or [EFAULT] is returned or a SIGSEGV or SIGILL signal is returned.)
• The error value [EBADF] or [EFAULT] can be returned by the rewinddir( ) function.
527187-017 Hewlett-Packard Company 5−193