Open System Services Library Calls Reference Manual (G06.27+, H06.04+)
nftw(3) OSS Library Calls Reference Manual
Use on Guardian Objects
All Guardian files (that is, files in /G) that are visible to the opendir( ) function can be traversed.
This includes temporary and structured files.
Safeguard subsystem security controls on Guardian objects do not affect the outcome of a call to
the nftw( ) function.
Use From the Guardian Environment
The nftw() function is one of a set of functions that have the following effects when the first of
them is called from the Guardian environment:
• Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
• The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
• The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
NOTES
The nftw() function is reentrant, and care should be taken to ensure that the function supplied as
the function parameter is also reentrant.
If you use this function on the local / (slash) root directory, the action includes the /G and /E
directories. Actions appropriate for local OSS files under / often are not appropriate for local
Guardian files or for any files on other HP NonStop server nodes.
The UTILSGE environment variable that governs shell utility behavior can be used to test or
recommend whether use should include Guardian files or files on remote HP NonStop server
nodes. Note that UTILSGE settings are only advisory for functions; changing the variable value
does not affect function behavior. Refer to the environ(5) reference page either online or in the
Open System Services System Calls Reference Manual for more information about UTILSGE.
RETURN VALUES
The nftw() function continues processing until one of the following conditions occurs; it then
returns the appropriate value, as follows:
• If the traversal of the directory hierarchy is complete, the nftw( ) function returns the
value 0 (zero).
• If the function specified by the function parameter returns a value other than 0 (zero),
nftw() terminates its search and returns the value that was returned by function.
• If nftw() detects an error other than [EACCES], the value -1 is returned and errno is set
to indicate the error.
ERRORS
If any of the following conditions occurs, the nftw( ) function sets errno to the corresponding
value:
[EACCES] One of the following is true:
• Search permission is denied for any component of the path parameter.
• Read permission is denied for the path parameter.
5−6 Hewlett-Packard Company 527187-004