aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/tty_io.c21
-rw-r--r--include/linux/kernel.h3
-rw-r--r--kernel/exit.c21
3 files changed, 21 insertions, 24 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 114854c5554b..ae8f53c7972d 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2515,6 +2515,27 @@ struct pid *tty_get_pgrp(struct tty_struct *tty)
2515} 2515}
2516EXPORT_SYMBOL_GPL(tty_get_pgrp); 2516EXPORT_SYMBOL_GPL(tty_get_pgrp);
2517 2517
2518/*
2519 * This checks not only the pgrp, but falls back on the pid if no
2520 * satisfactory pgrp is found. I dunno - gdb doesn't work correctly
2521 * without this...
2522 *
2523 * The caller must hold rcu lock or the tasklist lock.
2524 */
2525static struct pid *session_of_pgrp(struct pid *pgrp)
2526{
2527 struct task_struct *p;
2528 struct pid *sid = NULL;
2529
2530 p = pid_task(pgrp, PIDTYPE_PGID);
2531 if (p == NULL)
2532 p = pid_task(pgrp, PIDTYPE_PID);
2533 if (p != NULL)
2534 sid = task_session(p);
2535
2536 return sid;
2537}
2538
2518/** 2539/**
2519 * tiocgpgrp - get process group 2540 * tiocgpgrp - get process group
2520 * @tty: tty passed by user 2541 * @tty: tty passed by user
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 3d770f5564b8..01bc530fbfcb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -411,9 +411,6 @@ extern int __kernel_text_address(unsigned long addr);
411extern int kernel_text_address(unsigned long addr); 411extern int kernel_text_address(unsigned long addr);
412extern int func_ptr_is_kernel_text(void *ptr); 412extern int func_ptr_is_kernel_text(void *ptr);
413 413
414struct pid;
415extern struct pid *session_of_pgrp(struct pid *pgrp);
416
417unsigned long int_sqrt(unsigned long); 414unsigned long int_sqrt(unsigned long);
418 415
419extern void bust_spinlocks(int yes); 416extern void bust_spinlocks(int yes);
diff --git a/kernel/exit.c b/kernel/exit.c
index 5d30019ff953..6a3e2e5004ba 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -215,27 +215,6 @@ repeat:
215} 215}
216 216
217/* 217/*
218 * This checks not only the pgrp, but falls back on the pid if no
219 * satisfactory pgrp is found. I dunno - gdb doesn't work correctly
220 * without this...
221 *
222 * The caller must hold rcu lock or the tasklist lock.
223 */
224struct pid *session_of_pgrp(struct pid *pgrp)
225{
226 struct task_struct *p;
227 struct pid *sid = NULL;
228
229 p = pid_task(pgrp, PIDTYPE_PGID);
230 if (p == NULL)
231 p = pid_task(pgrp, PIDTYPE_PID);
232 if (p != NULL)
233 sid = task_session(p);
234
235 return sid;
236}
237
238/*
239 * Determine if a process group is "orphaned", according to the POSIX 218 * Determine if a process group is "orphaned", according to the POSIX
240 * definition in 2.2.2.52. Orphaned process groups are not to be affected 219 * definition in 2.2.2.52. Orphaned process groups are not to be affected
241 * by terminal-generated stop signals. Newly orphaned process groups are 220 * by terminal-generated stop signals. Newly orphaned process groups are