tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: O_NOACCESS?
On Feb 10, 2012, at 11:04 PM, Mouse wrote:
> 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.
Why not use O_DIRECTORY (which is part of -current) and add that to flags?
Home |
Main Index |
Thread Index |
Old Index