Messages in this thread | ![/](/images/icornerl.gif) | | From | (bill davidsen) | Subject | Re: Who changed /proc/<pid>/ in 2.6.0-test5-bk9? | Date | 6 Oct 2003 02:57:30 GMT |
| |
In article <blgol5$vd0$1@news.cistron.nl>, Miquel van Smoorenburg <miquels@cistron.nl> wrote: | In article <3F7B9CF9.4040706@redhat.com>, | Ulrich Drepper <drepper@redhat.com> wrote: | >Linus Torvalds wrote: | > | >> I think /proc/self most likely _should_ point into the thread, not the | >> task. | > | >As much as I want to not see this, I fear I have to agree. | > | >There is, for instance, no guarantee that all CLONE_THREAD clones also | >have CLONE_FILES set. Then using /proc/self/%d for some thread-local | >file descriptor will return the process group leaders file descriptor, | >not the own. | | How about use /proc/self/task/self/fd/%d if /proc/self/task/self | exists, /proc/self/fd/%d otherwise ?
Let me bend your suggestion slightly and suggest that for a task which shares fd with the leader, /proc/N/task/M/fd would be a symlink to /proc/M/fd, and if fd's were not shared it would be a directory. That would make it easy for programs like lsof to know when to look and whn not.
This doesn't prevent your suggestion which triggered the thought, it just seems to avoid having a boatload of symlinks for the most common case when one would do. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc Doing interesting things with little computers since 1979. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |