Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5feb8f5f authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds
Browse files

[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: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bbf73147
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -94,6 +94,14 @@ extern struct pid *find_ge_pid(int nr);
extern struct pid *alloc_pid(void);
extern void FASTCALL(free_pid(struct pid *pid));

static inline pid_t pid_nr(struct pid *pid)
{
	pid_t nr = 0;
	if (pid)
		nr = pid->nr;
	return nr;
}

#define pid_next(task, type)					\
	((task)->pids[(type)].node.next)