Re: Why is chmod(2)?

H. Peter Anvin (hpa@transmeta.com)
24 Sep 1999 09:00:41 GMT


Followup to: <199909232039.WAA24072@valiant.koehntopp.de>
By author: Kristian Koehntopp <kris@koehntopp.de>
In newsgroup: linux.dev.kernel

> which prints "f1". This reminded me of the fact that in Linux
> all filedescriptors have in fact names in the /proc directory,
> which kind of turns my original argument around: Since all fds
> have names, you can actually use the regular system calls to
> access them and are not required to use the f-calls instead. In
> his Example, Rainer demonstrates this by emulating the
> nonexistent fexecve() with a regular execve() on file descriptor 3.
>

Unfortunately, this works with some calls, but the semantics of
/proc/*/fd are a little screwy -- they don't dup() the file
descriptor, rather, they *open the same object again*. Meaning a
different file pointer, etc.

This is due to the way open is implemented in the VFS. I've been
meaning to hack up a different design and run it by the community, but
haven't gotten a chance yet. Perhaps in 2.5...

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!

- 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/