Re: Why is chmod(2)?

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Thu, 23 Sep 1999 18:33:23 +0200


Werner Almesberger wrote:
> Jamie Lokier wrote:
> > I recommend coding a patch to find out if O_NONE is really as easy as it
> > seems.
>
> Note that the equivalent of O_NONE has been around on Linux since '92 or
> so (numeric value 3, I usually call it O_NOACCESS). It is required for
> things like fdformat and setfdprm. LILO also uses it. So the "main code
> path" already supports this. Drivers looking at f_mode or f_flags may be
> a different story, though.

I'm suggesting a file opened O_NONE would never call driver code.
It's just an inode reference, for the same kind of operations you can do
with a file name.

So fstat() and close() are allowed, but ioctl(), fcntl(), read()
etc. will all fail without calling any drivers or filesystem code.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/