diff options
| author | Ingo Molnar <mingo@elte.hu> | 2002-12-01 16:42:53 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-01 16:42:53 -0800 |
| commit | d86f4ccdbd6a7afa19e31d880c78a9ce93355b8f (patch) | |
| tree | 0f7b56e9c755b00ec818deb16eb8cfb73dc67443 /include/linux | |
| parent | 79cd7c1c80d5049c181aeea0144acf9f871cea5f (diff) | |
[PATCH] getppid-2.5.50-A3
This changes sys_getppid() to be more POSIX-threading conformant.
sys_getppid() needs to return the PID of the "process' parent" (ie. the
tgid of the parent thread), not the thread parent's PID. The patch has
no effect on non-CLONE_THREAD users, for them current->group_leader ==
current. The effect on CLONE_THREAD threads is that getppid() does not
return any PID within the thread group anymore. Plus if a threaded
application starts up a (non-thread) child then the child sees the
process PID of the parent process, not the thread PID of the parent
thread.
in theory we could introduce the getttid() variant to get to the TID of
the parent thread, but i doubt it would be of any use. (and we can add
it if the need arises.)
The lockless algorithm is still safe because the ->group_leader pointer
never changes asynchronously. (the ->real_parent pointer might still
change asynchronously so the SMP checks are still needed.)
I've also updated the comments (they referenced the nonexistent p_ooptr
field.), plus i've changed the mb() to rmb() - we need to order the
reads, we dont do any global writes that need some predictable ordering.
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
