While traversing a directory using nftw like so,
nftw((argc < 2) ? "." : argv[1], rm, 20, FTW_DEPTH|FTW_PHYS)
nftw is passing a value of 5 to the rm function's tflag parameter when it encounters a directory. The ftw.h header only specifies an enum with 4 values (0-3) for the tflag parameter, of which FTW_D or 1 is the appropriate value for a directory. The fpath value appears to be correct in all instances.
So my question is this. Why is it passing 5 and not 1 for the tflag, and what does 5 mean for the tflag?
EDIT:
The value was in fact FTW_DP (Directory, all subdirs have been visited) which was defined below in an environment dependent portion which I failed to notice.