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

OSS Library Calls (e - f) fnmatch(3)
A period is determined to be leading according to the setting of the FNM_PATHNAME ag, as
follows:
If FNM_PATHNAME is set, a period is leading only if it is the rst character in the
string parameter or if it immediately follows a slash.
If FNM_PATHNAME is not set, a period is leading only if it is the rst character of the
string parameter.
NOTES
If you use this function on the local / (slash) root directory, the action includes the /G and /E
directories. Actions appropriate for local OSS les under / often are not appropriate for local
Guardian les or for any les 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 les or les 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
If the value in the string parameter matches the pattern specied by the pattern parameter, then
the fnmatch() function returns 0 (zero). If there is no match, fnmatch() returns one of the fol-
lowing values, which are dened in the fnmatch.h header le:
FNM_NOMATCH
Indicates that the string does not match the specied pattern.
FNM_ESLASH
Indicates that a slash (/) in the string is not exactly matched by a slash in the
specied pattern.
FNM_EPERIOD
Indicates that a leading period (.) in the string is not exactly matched by a period
in the specied pattern.
For conformance with the XPG4 specication, the fnmatch.h header le also denes the return
ag FNM_NOSYS, which would indicate that the function was not implemented.
If an error occurs, fnmatch() returns a nonzero value other than these return ags.
ERRORS
None. This function does not set errno.
RELATED INFORMATION
Functions: glob(3), globfree(3), regcomp(3).
STANDARDS CONFORMANCE
The following are HP extensions to the XPG4 Version 2 specication:
The return value ags FNM_ESLASH and FNM_EPERIOD are dened.
527187-007 Hewlett-Packard Company 253