Date: Wed, 13 Mar 2019 18:51:33 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345098 - in head/sys/compat/linuxkpi/common: include/linux src Message-ID: <201903131851.x2DIpXfR088361@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Mar 13 18:51:33 2019 New Revision: 345098 URL: https://svnweb.freebsd.org/changeset/base/345098 Log: Implement current_exiting() in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/src/linux_current.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Wed Mar 13 18:47:17 2019 (r345097) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Wed Mar 13 18:51:33 2019 (r345098) @@ -143,6 +143,11 @@ linux_schedule_save_interrupt_value(struct task_struct task->bsd_interrupt_value = value; } +bool linux_task_exiting(struct task_struct *task); + +#define current_exiting() \ + linux_task_exiting(current) + static inline int linux_schedule_get_interrupt_value(struct task_struct *task) { Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Wed Mar 13 18:47:17 2019 (r345097) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Wed Mar 13 18:51:33 2019 (r345098) @@ -215,6 +215,22 @@ linux_get_pid_task(pid_t pid) return (NULL); } +bool +linux_task_exiting(struct task_struct *task) +{ + struct proc *p; + bool ret; + + ret = false; + p = pfind(task->pid); + if (p != NULL) { + if ((p->p_flag & P_WEXIT) != 0) + ret = true; + PROC_UNLOCK(p); + } + return (ret); +} + static void linux_current_init(void *arg __unused) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903131851.x2DIpXfR088361>