From a6557ed0233e2193cef0ab5b4cea7f1d7f19ad5d Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 4 Jul 2024 23:40:37 +0300 Subject: use notification framework for orphanizing threads --- include/kmi/syscalls.h | 3 +++ include/kmi/uapi.h | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h index 93d0ac9..4ae0f0b 100644 --- a/include/kmi/syscalls.h +++ b/include/kmi/syscalls.h @@ -186,6 +186,9 @@ enum notify_flag { /** An interrupt request. */ NOTIFY_IRQ = (1 << 2), + + /** Thread has become orphaned. */ + NOTIFY_ORPHANED = (1 << 3), }; /* function declarations should be somewhere else, this file could be used in diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h index 76a759f..42d6e5b 100644 --- a/include/kmi/uapi.h +++ b/include/kmi/uapi.h @@ -843,18 +843,16 @@ SYSCALL_DECLARE1(exit, tid); /** * Request that a thread becomes orphant, i.e. eventually attached to the init - * process. Can be used to stop threads within a process by sending an - * appropriate signal to the troublesome thread which then detaches itself from - * its root process. + * process. Can be used to stop threads within a process. * * @param t Current tcb. - * @param a Unused. + * @param tid Which thread to orphanize. * @param b Unused. * @param c Unused. * @param d Unused. * @param e Unused. */ -SYSCALL_DECLARE0(detach); +SYSCALL_DECLARE1(detach, tid); /** @} */ -- cgit v1.3