/* "I ask you, have you ever known what it is to be an orphan?"  */
static int will_become_orphaned_pgrp(struct pid *pgrp, struct task_struct *ignored_task)
/* "I ask you, have you ever known what it is to be an orphan?"  */
static int will_become_orphaned_pgrp(struct pid *pgrp, struct task_struct *ignored_task)
{
	struct task_struct *p;
	do_each_pid_task(pgrp, PIDTYPE_PGID, p) {
		if ((p == ignored_task) ||
		    (p->exit_state && thread_group_empty(p)) ||
		    is_global_init(p->real_parent))
			continue;
		if (task_pgrp(p->real_parent) != pgrp &&
		    task_session(p->real_parent) == task_session(p))
			return 0;
	} while_each_pid_task(pgrp, PIDTYPE_PGID, p);
	return 1;
}