On Wed, 30 May 2007 14:27:52 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:
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
-