lkml.org 
[lkml]   [2003]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Who changed /proc/<pid>/ in 2.6.0-test5-bk9?
Date
In article <Pine.LNX.4.44.0310010803530.23860-100000@home.osdl.org>,
Linus Torvalds <torvalds@osdl.org> wrote:
| On Wed, 1 Oct 2003, Mikael Pettersson wrote:
| >
| > Linus' 2.6.0-test6 announcement doesn't seem to mention the
| > fact that 2.6.0-test5-bk9 fundamentally changed the semantics
| > of /proc/self and the /proc/<pid> name space.
|
| Well, that's because the semantics weren't _supposed_ to change. The new
| semantics were meant to be a superset of the old behaviour, with just the
| added "task" subdirectory that lists the actual threads.
|
| However, you're right that "/proc/self" should likely point into the
| _thread_, and not into the task. But it's debatable. You are very likely
| the only one who could ever care ;)

Well, it's a subtle detail, and it would be well to document such. He
may be the only person to use that, but it's certainly not intuitive,
and if I were to ever do this I'm certainly alerted that it might
violate Plauger's law of least astonishment. I would hope it points to
the thread, but if it doesn't it's not something I use every day ;-)
|
| > I don't actually disagree with the change, but it took me by
| > surprise since neither the 2.6.0-test6 annoucement nor the
| > diff between the t5-bk8 and t5-bk9 logs seem to mention it.
|
| Well, the changelog mentions "fix for hidden task problem", since the diff
| really is mainly to _add_ threads to the /proc layout. The fact that it
| changed /proc/self is actually a bit surprising. Albert?

When I get this one built I'm going to see which getpid() (and family)
returns as well, I never though of using /proc/self from a thread, but
I do on rare occasions get my pid.
|
| > (It broke the perfctr driver, but I'm handling that by making
| > an already planned API switch now instead of later.)
|
| I think /proc/self most likely _should_ point into the thread, not the
| task.

Hopefully that was an unintended side effect.
--
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/

\
 
 \ /
  Last update: 2005-03-22 13:49    [from the cache]
©2003-2011 Jasper Spaans