1
0
mirror of https://github.com/golang/go synced 2024-10-04 08:21:22 -06:00

[dev.power64] runtime: ignore rt_sigaction error if it's for SIGRTMAX.

Workaround a qemu linux user space emulation bug.
ref: http://git.qemu.org/?p=qemu.git;a=blob;f=linux-user/signal.c;h=1141054be2170128d6f7a340b41484b49a255936;hb=HEAD#l82

LGTM=rsc
R=rsc, iant
CC=golang-codereviews
https://golang.org/cl/124900043
This commit is contained in:
Shenghou Ma 2014-08-11 23:32:33 -04:00
parent 26c9bbf736
commit 8881e032d4

View File

@ -312,7 +312,8 @@ runtime·setsig(int32 i, GoSighandler *fn, bool restart)
if(fn == runtime·sighandler)
fn = (void*)runtime·sigtramp;
sa.sa_handler = fn;
if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0)
// Qemu rejects rt_sigaction of SIGRTMAX (64).
if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0 && i != 64)
runtime·throw("rt_sigaction failure");
}