lkml.org 
[lkml]   [2006]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
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
Date

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/

\
 
 \ /
  Last update: 2006-02-06 20:32    [W:0.398 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site