Messages in this thread Patch in this message | | | Subject | [RFC][PATCH 02/20] pspace: The parent process id of pid 1 is always 0. | From | (Eric W. Biederman) | Date | Mon, 06 Feb 2006 12:27:08 -0700 |
| |
Force the parent process id of pid == 1 to always be 0. Force this for nested pspaces.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
arch/alpha/kernel/entry.S | 3 +++ kernel/timer.c | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)
bec203c8a3e7bec5e3bee8086361caffa71ad685 diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index 7af15bf..38996ab 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S @@ -891,6 +891,9 @@ sys_getxpid: cmpeq $4, $5, $5 beq $5, 1b #endif + cmpeq $0, 1, $5 + cmoveq $5, 0, $1 + stq $1, 80($sp) ret .end sys_getxpid diff --git a/kernel/timer.c b/kernel/timer.c index 4f1cb0a..bae17fb 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -987,6 +987,8 @@ asmlinkage long sys_getppid(void) #endif break; } + if (current->tgid == 1) + pid = 0; return pid; } -- 1.1.5.g3480 - 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/
| |