if we were to use sizeof(sa.sa_mask) instead of 8 as the last argument
to rt_sigaction, we would have already fixed this bug, so also updated
Linux/386 and Linux/amd64 files to use that; also test the return value
of rt_sigaction.
R=dave, rsc
CC=golang-dev
https://golang.org/cl/
6297087
void *sa_handler;
uint32 sa_flags;
void *sa_restorer;
- uint32 sa_mask;
+ uint64 sa_mask;
};
#pragma pack off
int32 runtime·clone(int32, void*, M*, G*, void(*)(void));
struct Sigaction;
-void runtime·rt_sigaction(uintptr, struct Sigaction*, void*, uintptr);
+int32 runtime·rt_sigaction(uintptr, struct Sigaction*, void*, uintptr);
void runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
void runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
if(fn == runtime·sighandler)
fn = (void*)runtime·sigtramp;
sa.k_sa_handler = fn;
- runtime·rt_sigaction(i, &sa, nil, 8);
+ if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0)
+ runtime·throw("rt_sigaction failure");
}
#define AT_NULL 0
if(fn == runtime·sighandler)
fn = (void*)runtime·sigtramp;
sa.sa_handler = fn;
- runtime·rt_sigaction(i, &sa, nil, 8);
+ if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0)
+ runtime·throw("rt_sigaction failure");
}
if(fn == runtime·sighandler)
fn = (void*)runtime·sigtramp;
sa.sa_handler = fn;
- runtime·rt_sigaction(i, &sa, nil, 8);
+ if(runtime·rt_sigaction(i, &sa, nil, sizeof(sa.sa_mask)) != 0)
+ runtime·throw("rt_sigaction failure");
}
#define AT_NULL 0