]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: enable sigPerThreadSyscall handling on android
authorMichael Pratt <mpratt@google.com>
Tue, 15 Feb 2022 18:22:45 +0000 (13:22 -0500)
committerMichael Pratt <mpratt@google.com>
Tue, 15 Feb 2022 19:04:00 +0000 (19:04 +0000)
CL 383434 forgot to enable these paths for android, which is still linux
just not via GOOS.

Fixes #51213.

Change-Id: I102e53e8671403ded6edb4ba04789154d7a0730b
Reviewed-on: https://go-review.googlesource.com/c/go/+/385954
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/runtime/signal_unix.go

index 6f25fc91fa2cf95c6effada85a88a4a483d1acd8..2dd4cc51a34ec12cb2232714b9cd04a9322678fd 100644 (file)
@@ -161,7 +161,7 @@ func sigInstallGoHandler(sig uint32) bool {
                }
        }
 
-       if GOOS == "linux" && !iscgo && sig == sigPerThreadSyscall {
+       if (GOOS == "linux" || GOOS == "android") && !iscgo && sig == sigPerThreadSyscall {
                // sigPerThreadSyscall is the same signal used by glibc for
                // per-thread syscalls on Linux. We use it for the same purpose
                // in non-cgo binaries.
@@ -623,7 +623,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
                return
        }
 
-       if GOOS == "linux" && sig == sigPerThreadSyscall {
+       if (GOOS == "linux" || GOOS == "android") && sig == sigPerThreadSyscall {
                // sigPerThreadSyscall is the same signal used by glibc for
                // per-thread syscalls on Linux. We use it for the same purpose
                // in non-cgo binaries. Since this signal is not _SigNotify,