This is the mail archive of the 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: Revisiting O_SEARCH and O_EXEC

On Mon, Aug 05, 2013 at 10:19:47AM +0200, Christoph Hellwig wrote:
> On Sun, Aug 04, 2013 at 09:38:38PM +0000, Joseph S. Myers wrote:
> > On Fri, 2 Aug 2013, Rich Felker wrote:
> > 
> > > Another option, which I like better, is defining both O_EXEC and
> > > O_SEARCH to 3. This makes them look more like access modes, as they
> > > should, and avoids the need to change the definition of O_ACCMODE.
> > > However, I think this option would require agreement from the kernel
> > > folks, since it would be big trouble if they later wanted to use this
> > > value for something else. On the plus side, using the value of 3 would
> > > allow the kernel folks to explicitly support O_SEARCH and O_EXEC
> > > semantics kernel-side in the future, without help from the userspace
> > > library functions.
> > 
> > *Whatever* the option I think it should be coordinated with the kernel in 
> > the first place.
> *nod*
> I can't see any reason why implementing these two modes in libc would be
> preferable over doing it in the kernel.  I could think of many reasons why it
> would be a bad idea.
> Rich, given that you're obviously interested in implementing this feature,
> how about you try to send patches implemnenting it in the kernel?

The kernel folks position from the beginning (see the early threads
where O_PATH was added) seems to be that they think they've provided
enough for O_SEARCH and O_EXEC and that they don't want to design to
POSIX but instead design something that's general enough to provide
what POSIX requires. I think this is misguided, but I don't want to
have that argument. In any case, adding it to the kernel only is
useless because userspace won't be able to provide it until everybody
has switched to Linux 3.11+. That'll be 10+ years. Userspace must
provide it with what we have to work with as long as Linux 2.6 is
relevant (supported by the libc).

FYI, having the macros in fcntl.h but non-working breaks packages
including coreutils.


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