Print this page
1438 ftw(3C) should mention `quit' member of struct FTW and possible values

@@ -148,13 +148,28 @@
 
 
            o      The fourth argument is a pointer to an FTW structure that
                   contains the following members:
 
+                    int   quit;
                     int   base;
                     int   level;
 
+                  The quit member has a default value of 0, but can be set to
+                  the following values:
+
+
+                  FTW_SKIP or FTW_PRUNE
+                             This object and its descendants are pruned from
+                             the search.
+
+
+                  FTW_FOLLOW
+                             If this object is a symbolic link, follow the
+                             link to its physical counterpart.
+
+
                   The base member is the offset of the object's filename in
                   the pathname passed as the first argument to fn(). The value
                   of level indicates the depth relative to the root of the
                   walk, where the root level is 0.
 

@@ -161,22 +176,23 @@
                   The results are unspecified if the application-supplied fn()
                   function does not preserve the current working directory.
 
 
        Both ftw() and nftw() use one file descriptor for each level in the
-       tree. The depth argument limits the number of file descriptors used. If
-       depth is zero or negative, the effect is the same as if it were 1. It
-       must not be greater than the number of file descriptors currently
-       available for use.  The ftw() function runs faster if depth is at least
-       as large as the number of levels in the tree. Both ftw() and nftw() are
-       able to descend to arbitrary depths in a file hierarchy and do not fail
-       due to path length limitations unless either the length of the path
-       name pointed to by the path argument exceeds {PATH_MAX} requirements,
-       or for ftw(), the specified depth is less than 2, or for nftw(), the
-       specified depth is less than 2 and FTW_CHDIR is not set. When ftw() and
-       nftw() return, they close any file descriptors they have opened; they
-       do not close any file descriptors that might have been opened by fn.
+           tree. The depth argument limits the number of file descriptors
+           used. If depth is zero or negative, the effect is the same as if it
+           were 1. It must not be greater than the number of file descriptors
+           currently available for use.  The ftw() function runs faster if
+           depth is at least as large as the number of levels in the tree.
+           Both ftw() and nftw() are able to descend to arbitrary depths in a
+           file hierarchy and do not fail due to path length limitations
+           unless either the length of the path name pointed to by the path
+           argument exceeds {PATH_MAX} requirements, or for ftw(), the
+           specified depth is less than 2, or for nftw(), the specified depth
+           is less than 2 and FTW_CHDIR is not set. When ftw() and nftw()
+           return, they close any file descriptors they have opened; they do
+           not close any file descriptors that might have been opened by fn.
 
 RETURN VALUES
        If the tree is exhausted, ftw() and nftw() return 0. If the function
        pointed to by fn returns a non-zero value, ftw() and nftw() stop their
        tree traversal and return whatever value was returned by the function