diff options
author | Jim Meyering <jim@meyering.net> | 2006-05-15 10:00:16 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-05-15 10:00:16 +0000 |
commit | 7729ee5e68d2590f7723bdbaa4f0d07d8dc96db0 (patch) | |
tree | c7efecd5d8e3c744bf0f8f87a78db64e8759891e /lib/fts_.h | |
parent | 48138763f05fa312089223282f2a162117f2f8d9 (diff) | |
download | coreutils-7729ee5e68d2590f7723bdbaa4f0d07d8dc96db0.tar.xz |
Restore the parts of fts that were removed on 2006-01-17, so that
it's easier for legacy applications designed for the version
of fts in glibc or BSD to convert to this more robust version.
Add a new mode, FTS_CWDFD, by which to enable the improved
(openat- based -- aka no-chdir) semantics.
* fts_.h (FTS_CWDFD): Define. Callers must use this fts_open
option to enable the more robust behavior.
(FTS_OPTIONMASK): Widen accordingly.
* fts.c: Restore removed code, reverting the default behavior.
Diffstat (limited to 'lib/fts_.h')
-rw-r--r-- | lib/fts_.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/fts_.h b/lib/fts_.h index 4dbc8237f..2843107ea 100644 --- a/lib/fts_.h +++ b/lib/fts_.h @@ -72,6 +72,7 @@ typedef struct { struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* file name for this descent */ + int fts_rfd; /* fd for root */ int fts_cwd_fd; /* the file descriptor on which the virtual cwd is open, or AT_FDCWD */ size_t fts_pathlen; /* sizeof(path) */ @@ -113,7 +114,16 @@ typedef struct { mode of cycle detection: FTS_TIGHT_CYCLE_CHECK. */ # define FTS_TIGHT_CYCLE_CHECK 0x0100 -# define FTS_OPTIONMASK 0x01ff /* valid user option mask */ + /* Use this flag to enable semantics with which the parent + application may be made both more efficient and more robust. + Whereas the default is to visit each directory in a recursive + traversal (via chdir), using this flag makes it so the initial + working directory is never changed. Instead, these functions + perform the traversal via a virtual working directory, maintained + through the file descriptor member, fts_cwd_fd. */ +# define FTS_CWDFD 0x0200 + +# define FTS_OPTIONMASK 0x03ff /* valid user option mask */ # define FTS_NAMEONLY 0x1000 /* (private) child names only */ # define FTS_STOP 0x2000 /* (private) unrecoverable error */ |