diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/init_task.h | 11 | ||||
-rw-r--r-- | include/linux/sched.h | 19 |
2 files changed, 23 insertions, 7 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 733790d4f7db..848a68af3d42 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -57,17 +57,18 @@ | |||
57 | .cpu_vm_mask = CPU_MASK_ALL, \ | 57 | .cpu_vm_mask = CPU_MASK_ALL, \ |
58 | } | 58 | } |
59 | 59 | ||
60 | #define INIT_SIGNALS(sig) { \ | 60 | #define INIT_SIGNALS(sig) { \ |
61 | .count = ATOMIC_INIT(1), \ | 61 | .count = ATOMIC_INIT(1), \ |
62 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 62 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
63 | .shared_pending = { \ | 63 | .shared_pending = { \ |
64 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ | 64 | .list = LIST_HEAD_INIT(sig.shared_pending.list), \ |
65 | .signal = {{0}}}, \ | 65 | .signal = {{0}}}, \ |
66 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 66 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
67 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 67 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
68 | .rlim = INIT_RLIMITS, \ | 68 | .rlim = INIT_RLIMITS, \ |
69 | .pgrp = 1, \ | 69 | .pgrp = 1, \ |
70 | .session = 1, \ | 70 | .tty_old_pgrp = 0, \ |
71 | { .__session = 1}, \ | ||
71 | } | 72 | } |
72 | 73 | ||
73 | extern struct nsproxy init_nsproxy; | 74 | extern struct nsproxy init_nsproxy; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 270d864a8ff1..6fec1d419714 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -436,7 +436,12 @@ struct signal_struct { | |||
436 | /* job control IDs */ | 436 | /* job control IDs */ |
437 | pid_t pgrp; | 437 | pid_t pgrp; |
438 | pid_t tty_old_pgrp; | 438 | pid_t tty_old_pgrp; |
439 | pid_t session; | 439 | |
440 | union { | ||
441 | pid_t session __deprecated; | ||
442 | pid_t __session; | ||
443 | }; | ||
444 | |||
440 | /* boolean value for session group leader */ | 445 | /* boolean value for session group leader */ |
441 | int leader; | 446 | int leader; |
442 | 447 | ||
@@ -1047,9 +1052,19 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1047 | return tsk->signal->pgrp; | 1052 | return tsk->signal->pgrp; |
1048 | } | 1053 | } |
1049 | 1054 | ||
1055 | static inline pid_t signal_session(struct signal_struct *sig) | ||
1056 | { | ||
1057 | return sig->__session; | ||
1058 | } | ||
1059 | |||
1050 | static inline pid_t process_session(struct task_struct *tsk) | 1060 | static inline pid_t process_session(struct task_struct *tsk) |
1051 | { | 1061 | { |
1052 | return tsk->signal->session; | 1062 | return signal_session(tsk->signal); |
1063 | } | ||
1064 | |||
1065 | static inline void set_signal_session(struct signal_struct *sig, pid_t session) | ||
1066 | { | ||
1067 | sig->__session = session; | ||
1053 | } | 1068 | } |
1054 | 1069 | ||
1055 | static inline struct pid *task_pid(struct task_struct *task) | 1070 | static inline struct pid *task_pid(struct task_struct *task) |