|
@@ -556,6 +556,14 @@ extern bool current_is_single_threaded(void);
|
|
|
typedef int (*proc_visitor)(struct task_struct *p, void *data);
|
|
|
void walk_process_tree(struct task_struct *top, proc_visitor, void *);
|
|
|
|
|
|
+static inline
|
|
|
+struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
|
|
|
+{
|
|
|
+ if (type != PIDTYPE_PID)
|
|
|
+ task = task->group_leader;
|
|
|
+ return task->pids[type].pid;
|
|
|
+}
|
|
|
+
|
|
|
static inline int get_nr_threads(struct task_struct *tsk)
|
|
|
{
|
|
|
return tsk->signal->nr_threads;
|