diff options
Diffstat (limited to 'include/linux/pid.h')
-rw-r--r-- | include/linux/pid.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pid.h b/include/linux/pid.h index 49f1c2f66e95..efceda0a51b1 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -141,6 +141,17 @@ static inline struct pid_namespace *ns_of_pid(struct pid *pid) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * is_child_reaper returns true if the pid is the init process | ||
145 | * of the current namespace. As this one could be checked before | ||
146 | * pid_ns->child_reaper is assigned in copy_process, we check | ||
147 | * with the pid number. | ||
148 | */ | ||
149 | static inline bool is_child_reaper(struct pid *pid) | ||
150 | { | ||
151 | return pid->numbers[pid->level].nr == 1; | ||
152 | } | ||
153 | |||
154 | /* | ||
144 | * the helpers to get the pid's id seen from different namespaces | 155 | * the helpers to get the pid's id seen from different namespaces |
145 | * | 156 | * |
146 | * pid_nr() : global id, i.e. the id seen from the init namespace; | 157 | * pid_nr() : global id, i.e. the id seen from the init namespace; |