Change sigaction_f to match sysv signature (#585)

This commit is contained in:
Gavin Hayes 2022-09-02 08:08:35 -04:00 committed by GitHub
parent 33b5b5b312
commit 263711965f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 46 additions and 35 deletions

View file

@ -74,7 +74,7 @@ TEST(reservefd, testGrowthOfFdsDataStructure) {
}
}
void OnSigAlrm(int sig, siginfo_t *si, ucontext_t *ctx) {
void OnSigAlrm(int sig, siginfo_t *si, void *ctx) {
int rc, fd;
char buf[64];
ASSERT_NE(-1, (fd = open("/zip/libc/testlib/hyperion.txt", O_RDONLY)));

View file

@ -35,7 +35,7 @@ void SetUpOnce(void) {
ASSERT_SYS(0, 0, pledge("stdio", 0));
}
void OnSigAlrm(int sig, siginfo_t *si, ucontext_t *ctx) {
void OnSigAlrm(int sig, siginfo_t *si, void *ctx) {
EXPECT_EQ(SIGALRM, sig);
EXPECT_EQ(SIGALRM, si->si_signo);
gotsig = true;

View file

@ -111,7 +111,8 @@ TEST(sigaction, testPingPongParentChildWithSigint) {
volatile int trapeax;
void OnTrap(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnTrap(int sig, struct siginfo *si, void *vctx) {
struct ucontext *ctx = vctx;
CheckStackIsAligned();
trapeax = ctx->uc_mcontext.rax;
}
@ -136,7 +137,8 @@ void SkipOverFaultingInstruction(struct ucontext *ctx) {
ctx->uc_mcontext.rip += xedd.length;
}
void OnFpe(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnFpe(int sig, struct siginfo *si, void *vctx) {
struct ucontext *ctx = vctx;
CheckStackIsAligned();
SkipOverFaultingInstruction(ctx);
ctx->uc_mcontext.rax = 42;

View file

@ -43,7 +43,7 @@ TEST(signal, test) {
////////////////////////////////////////////////////////////////////////////////
// signal round-trip delivery takes about 1µs
void OnSigTrap(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnSigTrap(int sig, struct siginfo *si, void *ctx) {
}
void TrapBench(int n) {
@ -72,7 +72,8 @@ BENCH(signal, trapBenchSiginfo) {
sigaction(SIGTRAP, &old, 0);
}
void OnSigHlt(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnSigHlt(int sig, struct siginfo *si, void *vctx) {
struct ucontext *ctx = vctx;
ctx->uc_mcontext.rip += 1;
}

View file

@ -32,7 +32,7 @@ void SetUpOnce(void) {
ASSERT_SYS(0, 0, pledge("stdio proc", 0));
}
void OnSig(int sig, siginfo_t *si, ucontext_t *ctx) {
void OnSig(int sig, siginfo_t *si, void *ctx) {
++n;
}

View file

@ -31,7 +31,7 @@ volatile bool gotsig1;
volatile bool gotsig2;
volatile bool finished;
void OnSigQueuing(int sig, siginfo_t *si, ucontext_t *ctx) {
void OnSigQueuing(int sig, siginfo_t *si, void *ctx) {
if (!finished) {
EXPECT_EQ(SIGUSR2, sig);
EXPECT_EQ(SIGUSR2, si->si_signo);

View file

@ -47,12 +47,14 @@ void SkipOverFaultingInstruction(struct ucontext *ctx) {
ctx->uc_mcontext.rip += xedd.length;
}
void OnSigSegv(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnSigSegv(int sig, struct siginfo *si, void *vctx) {
struct ucontext *ctx = vctx;
gotsegv = true;
SkipOverFaultingInstruction(ctx);
}
void OnSigBus(int sig, struct siginfo *si, struct ucontext *ctx) {
void OnSigBus(int sig, struct siginfo *si, void *vctx) {
struct ucontext *ctx = vctx;
gotbusted = true;
SkipOverFaultingInstruction(ctx);
#if 0

View file

@ -35,8 +35,9 @@
volatile int gotsignal;
char testlib_enable_tmp_setup_teardown;
void ContinueOnError(int sig, siginfo_t *si, ucontext_t *ctx) {
void ContinueOnError(int sig, siginfo_t *si, void *vctx) {
struct XedDecodedInst xedd;
struct ucontext *ctx = vctx;
xed_decoded_inst_zero_set_mode(&xedd, XED_MACHINE_MODE_LONG_64);
xed_instruction_length_decode(&xedd, (void *)ctx->uc_mcontext.rip, 15);
ctx->uc_mcontext.rip += xedd.length;