]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: drop CLONE_PARENT
authorRuss Cox <rsc@golang.org>
Thu, 20 Jan 2011 18:36:00 +0000 (13:36 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 20 Jan 2011 18:36:00 +0000 (13:36 -0500)
The functionality we want (shared ppid) is implied
by CLONE_THREAD already, and CLONE_PARENT
causes problems if the Go program is pid 1 (init).

See issue 1406 for more details.

Fixes #1406.

R=adg, iant
CC=golang-dev
https://golang.org/cl/3971044

src/pkg/runtime/linux/thread.c

index 979260ba1d10866d78732d21d6e44b68bd194008..d5f9a8fb0e371c50ec0026427690ee8310db4c7b 100644 (file)
@@ -238,8 +238,7 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
        /*
         * note: strace gets confused if we use CLONE_PTRACE here.
         */
-       flags = CLONE_PARENT    /* getppid doesn't change in child */
-               | CLONE_VM      /* share memory */
+       flags = CLONE_VM        /* share memory */
                | CLONE_FS      /* share cwd, etc */
                | CLONE_FILES   /* share fd table */
                | CLONE_SIGHAND /* share sig handler table */