2006-01-17 14:51:07

by Serge E. Hallyn

[permalink] [raw]
Subject: RFC [patch 22/34] PID Virtualization define vpid_to_pid functions

Introduce the reverse conversion functions namely from the
user virtual pid to the kernel pid.
Again, we only specify the API here, will utilize the API
at the appropriate locations in subsequent patches and finally
will provide a real implementation for the virtualization
behind these functions together with the pid_to_vpid conversion.
Any pid passed through the syscall interface from userspace
is virtual and therefore must pass through this conversion
before it can be used as a kernel pid.

Signed-off-by: Hubertus Franke <[email protected]>
---
sched.h | 10 ++++++++++
1 files changed, 10 insertions(+)

Index: linux-2.6.15/include/linux/sched.h
===================================================================
--- linux-2.6.15.orig/include/linux/sched.h 2006-01-17 08:37:05.000000000 -0500
+++ linux-2.6.15/include/linux/sched.h 2006-01-17 08:37:06.000000000 -0500
@@ -878,6 +878,16 @@
return pid;
}

+static inline pid_t vpid_to_pid(pid_t pid)
+{
+ return pid;
+}
+
+static inline pid_t vpgid_to_pgid(pid_t pid)
+{
+ return pid;
+}
+
/**
* pid_alive - check that a task structure is not stale
* @p: Task structure to be checked.

--