aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common
diff options
context:
space:
mode:
authorJohannes Lundberg <johalun@FreeBSD.org>2019-05-16 17:53:36 +0000
committerJohannes Lundberg <johalun@FreeBSD.org>2019-05-16 17:53:36 +0000
commit07e0a3ca50d444bdc22f74dc6dd53b235a1a1d60 (patch)
treedaecb4cc38968ea6081c6ac481ab7804847e2ccb /sys/compat/linuxkpi/common
parent47e2723ad727c1952492dc018246ab39a6f0f5fe (diff)
downloadsrc-07e0a3ca50d444bdc22f74dc6dd53b235a1a1d60.tar.gz
src-07e0a3ca50d444bdc22f74dc6dd53b235a1a1d60.zip
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
Notes
Notes: svn path=/head/; revision=347843
Diffstat (limited to 'sys/compat/linuxkpi/common')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sched.h1
-rw-r--r--sys/compat/linuxkpi/common/src/linux_current.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h
index 73807d3d454e..0545710a61d7 100644
--- a/sys/compat/linuxkpi/common/include/linux/sched.h
+++ b/sys/compat/linuxkpi/common/include/linux/sched.h
@@ -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 ({ \
diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c
index ee9eeeafc7f0..5ebb9c7c3ad4 100644
--- a/sys/compat/linuxkpi/common/src/linux_current.c
+++ b/sys/compat/linuxkpi/common/src/linux_current.c
@@ -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);