diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-10-02 05:17:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-02 10:57:13 -0400 |
commit | 5feb8f5f8403d8874a04aac443692dfe83bd63d2 (patch) | |
tree | 8dc23051350f9a4bd22c3172dc570e96e73f3e50 | |
parent | bbf73147e2d46611fbdcbc126f887c614c32350b (diff) |
[PATCH] pid: implement pid_nr
As we stop storing pid_t's and move to storing struct pid *. We need a way to
get the pid_t from the struct pid to report to user space what we have stored.
Having a clean well defined way to do this is especially important as we move
to multiple pid spaces as may need to report a different value to the caller
depending on which pid space the caller is in.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/pid.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h index 8cf9b11ed264..dba1b2d677a3 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -94,6 +94,14 @@ extern struct pid *find_ge_pid(int nr); | |||
94 | extern struct pid *alloc_pid(void); | 94 | extern struct pid *alloc_pid(void); |
95 | extern void FASTCALL(free_pid(struct pid *pid)); | 95 | extern void FASTCALL(free_pid(struct pid *pid)); |
96 | 96 | ||
97 | static inline pid_t pid_nr(struct pid *pid) | ||
98 | { | ||
99 | pid_t nr = 0; | ||
100 | if (pid) | ||
101 | nr = pid->nr; | ||
102 | return nr; | ||
103 | } | ||
104 | |||
97 | #define pid_next(task, type) \ | 105 | #define pid_next(task, type) \ |
98 | ((task)->pids[(type)].node.next) | 106 | ((task)->pids[(type)].node.next) |
99 | 107 | ||