LinuxKPI: Add group_leader member to struct task_struct.

Assign self as group leader at creation to act as the only member of a
new process group.
This patch is part of D19565

Reviewed by:	hps
Approved by:	imp (mentor), hps
MFC after:	1 week
This commit is contained in:
Johannes Lundberg 2019-05-16 17:53:36 +00:00
parent 47e2723ad7
commit 07e0a3ca50
2 changed files with 2 additions and 0 deletions

View file

@ -80,6 +80,7 @@ struct task_struct {
int rcu_recurse;
int bsd_interrupt_value;
struct work_struct *work; /* current work struct, if set */
struct task_struct *group_leader;
};
#define current ({ \

View file

@ -67,6 +67,7 @@ linux_alloc_current(struct thread *td, int flags)
ts->task_thread = td;
ts->comm = td->td_name;
ts->pid = td->td_tid;
ts->group_leader = ts;
atomic_set(&ts->usage, 1);
atomic_set(&ts->state, TASK_RUNNING);
init_completion(&ts->parked);