This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] DT_WHT


On Mon, 2018-03-05 at 02:49 -0800, Rical Jasan wrote:
> On 03/04/2018 05:50 PM, Ben Hutchings wrote:
> > On Thu, 2018-03-01 at 15:02 -0800, Rical Jasan wrote:
> > > On 03/01/2018 08:24 AM, Ben Hutchings wrote:
> > > > On Wed, 2018-02-21 at 02:16 -0800, Rical Jasan wrote:
> > > > > There is one undocumented DT_* macro in manual/filesys.texi:
> > > > > DT_WHT.  It
> > > > > is defined in dirent/dirent.h and appears to be used once in io/fts.c:
> > > > > 
> > > > > #if defined FTS_WHITEOUT && 0
> > > > >                 if (dp->d_type == DT_WHT)
> > > > >                         p->fts_flags |= FTS_ISW;
> > > > > #endif
> > > > > 
> > > > > For an entry in the manual, I was thinking something along the lines of:
> > > > > 
> > > > > "This macro is obsolete and has no effect.  It was used to..."
> > > > > 
> > > > > but I'm not sure what to say about what it was used for.
> > > > 
> > > > [...]
> > > > > Lastly, I can't find a reference to it in any of the standards I've
> > > > > managed to obtain so far (not to say that's exhaustive at all).  Is this
> > > > > also BSD?
> > > > 
> > > > Some Linux filesystems support white-out directory entries for use with
> > > > union filesystems.  At least the coda and xfs implementations of
> > > > getdents() appear to be capable of setting d_type to DT_WHT.
> > > 
> > > The code as-is isn't used, though.  Other "#if ... 0" blocks also use
> > > some apparently whiteout-related macros that aren't defined anywhere.
> > > 
> > > Do you think instead of removing the unused code it should be changed to
> > > actually do something?
> > 
> > I have no opinion on that code, but it sounded like you proposed to
> > remove the macro definition too.  I wanted to point out that the macro
> > is meaningful and may be useful to applications.
> 
> It's a complete NOOP, though, so why should we provide it?

For the same reason glibc defines the other DT_* macros.

Ben.

-- 
Ben Hutchings
Software Developer, Codethink Ltd.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]