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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/ftw.3c.man.txt
          +++ new/usr/src/man/man3c/ftw.3c.man.txt
↓ open down ↓ 142 lines elided ↑ open up ↑
 143  143                               of lack of appropriate permission. The stat
 144  144                               buffer passed to fn is undefined.  Failure of
 145  145                               stat() for any other reason is considered an
 146  146                               error and nftw() returns 1.
 147  147  
 148  148  
 149  149  
 150  150             o      The fourth argument is a pointer to an FTW structure that
 151  151                    contains the following members:
 152  152  
      153 +                    int   quit;
 153  154                      int   base;
 154  155                      int   level;
 155  156  
      157 +                  The quit member has a default value of 0, but can be set to
      158 +                  the following values:
      159 +
      160 +
      161 +                  FTW_SKIP or FTW_PRUNE
      162 +                             This object and its descendants are pruned from
      163 +                             the search.
      164 +
      165 +
      166 +                  FTW_FOLLOW
      167 +                             If this object is a symbolic link, follow the
      168 +                             link to its physical counterpart.
      169 +
      170 +
 156  171                    The base member is the offset of the object's filename in
 157  172                    the pathname passed as the first argument to fn(). The value
 158  173                    of level indicates the depth relative to the root of the
 159  174                    walk, where the root level is 0.
 160  175  
 161  176                    The results are unspecified if the application-supplied fn()
 162  177                    function does not preserve the current working directory.
 163  178  
 164  179  
 165      -       Both ftw() and nftw() use one file descriptor for each level in the
 166      -       tree. The depth argument limits the number of file descriptors used. If
 167      -       depth is zero or negative, the effect is the same as if it were 1. It
 168      -       must not be greater than the number of file descriptors currently
 169      -       available for use.  The ftw() function runs faster if depth is at least
 170      -       as large as the number of levels in the tree. Both ftw() and nftw() are
 171      -       able to descend to arbitrary depths in a file hierarchy and do not fail
 172      -       due to path length limitations unless either the length of the path
 173      -       name pointed to by the path argument exceeds {PATH_MAX} requirements,
 174      -       or for ftw(), the specified depth is less than 2, or for nftw(), the
 175      -       specified depth is less than 2 and FTW_CHDIR is not set. When ftw() and
 176      -       nftw() return, they close any file descriptors they have opened; they
 177      -       do not close any file descriptors that might have been opened by fn.
      180 +           Both ftw() and nftw() use one file descriptor for each level in the
      181 +           tree. The depth argument limits the number of file descriptors
      182 +           used. If depth is zero or negative, the effect is the same as if it
      183 +           were 1. It must not be greater than the number of file descriptors
      184 +           currently available for use.  The ftw() function runs faster if
      185 +           depth is at least as large as the number of levels in the tree.
      186 +           Both ftw() and nftw() are able to descend to arbitrary depths in a
      187 +           file hierarchy and do not fail due to path length limitations
      188 +           unless either the length of the path name pointed to by the path
      189 +           argument exceeds {PATH_MAX} requirements, or for ftw(), the
      190 +           specified depth is less than 2, or for nftw(), the specified depth
      191 +           is less than 2 and FTW_CHDIR is not set. When ftw() and nftw()
      192 +           return, they close any file descriptors they have opened; they do
      193 +           not close any file descriptors that might have been opened by fn.
 178  194  
 179  195  RETURN VALUES
 180  196         If the tree is exhausted, ftw() and nftw() return 0. If the function
 181  197         pointed to by fn returns a non-zero value, ftw() and nftw() stop their
 182  198         tree traversal and return whatever value was returned by the function
 183  199         pointed to by fn. If ftw() and nftw() detect an error,  they return1
 184  200         and set errno to indicate the error.
 185  201  
 186  202  
 187  203         If ftw() and nftw() encounter an error other than EACCES (see FTW_DNR
↓ open down ↓ 177 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX