Page MenuHomeFreeBSD

D35175.id105864.diff
No OneTemporary

D35175.id105864.diff

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
@@ -85,11 +85,6 @@
#define WEXITED 16 /* Wait for exited processes. */
#define WTRAPPED 32 /* Wait for a process to hit a trap or
a breakpoint. */
-
-#if __BSD_VISIBLE
-#define WLINUXCLONE 0x80000000 /* Wait for kthread spawned from linux_clone. */
-#endif
-
#ifndef _IDTYPE_T_DECLARED
typedef enum
#if __BSD_VISIBLE

File Metadata

Mime Type
text/plain
Expires
Wed, Jun 24, 12:59 AM (19 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34266365
Default Alt Text
D35175.id105864.diff (2 KB)

Event Timeline