]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: pass CLONE_SYSVSEM to clone
authorAustin Clements <austin@google.com>
Wed, 12 Jul 2017 16:12:50 +0000 (10:12 -0600)
committerAustin Clements <austin@google.com>
Wed, 12 Jul 2017 17:42:50 +0000 (17:42 +0000)
SysV semaphore undo lists should be shared by threads, just like
several other resources listed in cloneFlags. Currently we don't do
this, but it probably doesn't affect anything because 1) probably
nobody uses SysV semaphores from Go and 2) Go-created threads never
exit until the process does. Beyond being the right thing to do,
user-level QEMU requires this flag because it depends on glibc to
create new threads and glibc uses this flag.

Fixes #20763.

Change-Id: I1d1dafec53ed87e0f4d4d432b945e8e68bb72dcd
Reviewed-on: https://go-review.googlesource.com/48170
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/os_linux.go

index a6efc0e3d1f11f10fe2770153bdfb8ee3baff8df..78899737b6cb8f0cf51441557d7ad1d2a4a924f5 100644 (file)
@@ -132,6 +132,7 @@ const (
                _CLONE_FS | /* share cwd, etc */
                _CLONE_FILES | /* share fd table */
                _CLONE_SIGHAND | /* share sig handler table */
+               _CLONE_SYSVSEM | /* share SysV semaphore undo lists (see issue #20763) */
                _CLONE_THREAD /* revisit - okay for now */
 )