Index: sys/compat/linux/linux_misc.c =================================================================== --- sys/compat/linux/linux_misc.c +++ sys/compat/linux/linux_misc.c @@ -996,6 +996,17 @@ } #endif + + +/* + * Since 81338031 (switch linuxulator to use the native 1:1 threads) + * _WALL, _WCLONE flags are broken due to the fact that (to Linux kernel) + * no distinction between processes and threads - everything is runnable + * task. This allows do a weird things like waiting for a thread status + * change by wait() API, unlike FreeBSD where wait() is process intended + * only. + */ + static int linux_common_wait(struct thread *td, idtype_t idtype, int id, int *statusp, int options, void *rup, l_siginfo_t *infop) @@ -2746,7 +2757,8 @@ *bsdopts |= WNOWAIT; if (options & __WCLONE) - *bsdopts |= WLINUXCLONE; + LINUX_RATELIMIT_MSG_OPT1("unsupported _WCLONE, options(0x%x)", + options); } int Index: sys/kern/kern_exit.c =================================================================== --- sys/kern/kern_exit.c +++ sys/kern/kern_exit.c @@ -1125,20 +1125,6 @@ return (0); } - /* - * This special case handles a kthread spawned by linux_clone - * (see linux_misc.c). The linux_wait4 and linux_waitpid - * functions need to be able to distinguish between waiting - * on a process and waiting on a thread. It is a thread if - * p_sigparent is not SIGCHLD, and the WLINUXCLONE option - * signifies we want to wait for threads and not processes. - */ - if ((p->p_sigparent != SIGCHLD) ^ - ((options & WLINUXCLONE) != 0)) { - PROC_UNLOCK(p); - return (0); - } - if (siginfo != NULL) { bzero(siginfo, sizeof(*siginfo)); siginfo->si_errno = 0; @@ -1301,7 +1287,7 @@ /* If we don't know the option, just return. */ if ((options & ~(WUNTRACED | WNOHANG | WCONTINUED | WNOWAIT | - WEXITED | WTRAPPED | WLINUXCLONE)) != 0) + WEXITED | WTRAPPED)) != 0) return (EINVAL); if ((options & (WEXITED | WUNTRACED | WCONTINUED | WTRAPPED)) == 0) { /* Index: sys/sys/wait.h =================================================================== --- sys/sys/wait.h +++ sys/sys/wait.h @@ -87,7 +87,7 @@ a breakpoint. */ #if __BSD_VISIBLE -#define WLINUXCLONE 0x80000000 /* Wait for kthread spawned from linux_clone. */ +#define WLINUXCLONE 0x80000000 /* Not used anymore. */ #endif #ifndef _IDTYPE_T_DECLARED