tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]


I find myself wanting something I'm tentatively calling O_NOACCESS,
which is basically "open for neither read nor write".  (I want this
mostly so I can open a --x directory for fchdir() purposes.)

Looking at sys_open(), I see that one of the first checks it does is

        if ((flags & (FREAD | FWRITE)) == 0)
                return (EINVAL);

I've tried what I think is the minial change: removing those lines,
defining O_NOACCESS as 3, and making FFLAGS and OFLAGS correspondingly
more complex.  It works, superficially.

I'm reasonably sure I haven't thought of all the implications; there's
so much code involved that it's practically certain there's something
somewhere that interacts with this in some way I haven't thought of.
Anyone know of any reason it would be a Bad Thing to go with this?
(Issues of compatability with POSIX or with kernels lacking this change
are not what I'm looking for here; for my purposes at the moment, those
are recognized and judged to be in the "don't care about" class.)

For the moment, 4.0.1 is of the most immediate practical import, but
I'd be interested in issues specific to other versions too.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index