diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index be658e33bd26..660b02f80523 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1020,6 +1020,26 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1020 | return tsk->signal->pgrp; | 1020 | return tsk->signal->pgrp; |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | static inline struct pid *task_pid(struct task_struct *task) | ||
1024 | { | ||
1025 | return task->pids[PIDTYPE_PID].pid; | ||
1026 | } | ||
1027 | |||
1028 | static inline struct pid *task_tgid(struct task_struct *task) | ||
1029 | { | ||
1030 | return task->group_leader->pids[PIDTYPE_PID].pid; | ||
1031 | } | ||
1032 | |||
1033 | static inline struct pid *task_pgrp(struct task_struct *task) | ||
1034 | { | ||
1035 | return task->group_leader->pids[PIDTYPE_PGID].pid; | ||
1036 | } | ||
1037 | |||
1038 | static inline struct pid *task_session(struct task_struct *task) | ||
1039 | { | ||
1040 | return task->group_leader->pids[PIDTYPE_SID].pid; | ||
1041 | } | ||
1042 | |||
1023 | /** | 1043 | /** |
1024 | * pid_alive - check that a task structure is not stale | 1044 | * pid_alive - check that a task structure is not stale |
1025 | * @p: Task structure to be checked. | 1045 | * @p: Task structure to be checked. |