diff options
author | Cedric Le Goater <clg@fr.ibm.com> | 2006-12-08 05:37:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:28:51 -0500 |
commit | 1ec320afdc9552c92191d5f89fcd1ebe588334ca (patch) | |
tree | e526fb29f9487f1ea34aa9ccdf14c318aea2159f /include/linux/sched.h | |
parent | 937949d9edbf4049bd41af6c9f92c26280584564 (diff) |
[PATCH] add process_session() helper routine: deprecate old field
Add an anonymous union and ((deprecated)) to catch direct usage of the
session field.
[akpm@osdl.org: fix various missed conversions]
[jdike@addtoit.com: fix UML bug]
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 19 |
1 files changed, 17 insertions, 2 deletions
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) |