Re: Syslets, Threadlets, generic AIO support, v6

From: David M. Lloyd
Date: Wed May 30 2007 - 18:20:26 EST


On Wed, 30 May 2007 14:27:52 -0700 (PDT)
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> Well, don't think of it as a special case at all: think of bit 30 as
> a "the user asked for a non-linear fd".

If the sole point is to protect an fd from being closed or operated on
outside of a certain context, why not just provide the ability to
"protect" an fd to prevent its use. Maybe a pair of syscalls like
"fdprotect" and "fdunprotect" that take an fd and an integer key.
Protected fds would return EBADF or something if accessed. The same
integer key must be provided to fdunprotect in order to gain access
to it again. Then glibc or valgrind or whatever would just unprotect
the fd before operating on it.

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