Favor siginfo_t over struct siginfo

This commit is contained in:
Justine Tunney 2024-05-28 02:34:17 -07:00
parent c638eabfe0
commit deaef81463
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
20 changed files with 37 additions and 39 deletions

View file

@ -81,7 +81,7 @@ void PromisedLand(void *arg) {
pthread_exit(arg);
}
void Teleporter(int sig, struct siginfo *si, void *ctx) {
void Teleporter(int sig, siginfo_t *si, void *ctx) {
ucontext_t *uc = ctx;
sigaddset(&uc->uc_sigmask, SIGUSR1);
uc->uc_mcontext.PC = (uintptr_t)PromisedLand;
@ -177,7 +177,7 @@ TEST(sigaction, testPingPongParentChildWithSigint) {
volatile int trapeax;
void OnTrap(int sig, struct siginfo *si, void *vctx) {
void OnTrap(int sig, siginfo_t *si, void *vctx) {
struct ucontext *ctx = vctx;
CheckStackIsAligned();
trapeax = ctx->uc_mcontext.rax;
@ -203,7 +203,7 @@ void SkipOverFaultingInstruction(struct ucontext *ctx) {
ctx->uc_mcontext.rip += xedd.length;
}
void OnFpe(int sig, struct siginfo *si, void *vctx) {
void OnFpe(int sig, siginfo_t *si, void *vctx) {
struct ucontext *ctx = vctx;
CheckStackIsAligned();
SkipOverFaultingInstruction(ctx);
@ -286,7 +286,7 @@ TEST(sigaction, enosys_returnsErrnoRatherThanSigsysByDefault) {
sig_atomic_t gotusr1;
void OnSigMask(int sig, struct siginfo *si, void *ctx) {
void OnSigMask(int sig, siginfo_t *si, void *ctx) {
ucontext_t *uc = ctx;
sigaddset(&uc->uc_sigmask, sig);
gotusr1 = true;
@ -329,7 +329,7 @@ TEST(sig_ign, discardsPendingSignalsEvenIfBlocked) {
ASSERT_SYS(0, 0, sigprocmask(SIG_SETMASK, &oldmask, 0));
}
void AutoMask(int sig, struct siginfo *si, void *ctx) {
void AutoMask(int sig, siginfo_t *si, void *ctx) {
sigset_t ss;
ucontext_t *uc = ctx;
sigprocmask(SIG_SETMASK, 0, &ss);
@ -347,7 +347,7 @@ TEST(sigaction, signalBeingDeliveredGetsAutoMasked) {
EXPECT_FALSE(sigismember(&ss, SIGUSR2)); // original mask
}
void NoDefer(int sig, struct siginfo *si, void *ctx) {
void NoDefer(int sig, siginfo_t *si, void *ctx) {
sigset_t ss;
ucontext_t *uc = ctx;
sigprocmask(SIG_SETMASK, 0, &ss);

View file

@ -48,7 +48,7 @@ TEST(signal, test) {
////////////////////////////////////////////////////////////////////////////////
// signal round-trip delivery takes about 1µs
void OnSigTrap(int sig, struct siginfo *si, void *ctx) {
void OnSigTrap(int sig, siginfo_t *si, void *ctx) {
}
void TrapBench(int n) {
@ -79,7 +79,7 @@ BENCH(signal, trapBenchSiginfo) {
#ifdef __x86_64__
void OnSigHlt(int sig, struct siginfo *si, void *vctx) {
void OnSigHlt(int sig, siginfo_t *si, void *vctx) {
struct ucontext *ctx = vctx;
ctx->uc_mcontext.rip += 1;
}

View file

@ -73,13 +73,13 @@ void SkipOverFaultingInstruction(struct ucontext *ctx) {
#endif
}
void OnSigSegv(int sig, struct siginfo *si, void *vctx) {
void OnSigSegv(int sig, siginfo_t *si, void *vctx) {
struct ucontext *ctx = vctx;
gotsegv = true;
SkipOverFaultingInstruction(ctx);
}
void OnSigBus(int sig, struct siginfo *si, void *vctx) {
void OnSigBus(int sig, siginfo_t *si, void *vctx) {
struct ucontext *ctx = vctx;
gotbusted = true;
SkipOverFaultingInstruction(ctx);

View file

@ -29,7 +29,6 @@
#include "libc/limits.h"
#include "libc/macros.internal.h"
#include "libc/mem/gc.h"
#include "libc/mem/gc.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/nexgen32e/vendor.internal.h"
@ -48,7 +47,7 @@
#include "libc/thread/thread.h"
#include "libc/thread/thread2.h"
void OnUsr1(int sig, struct siginfo *si, void *vctx) {
void OnUsr1(int sig, siginfo_t *si, void *vctx) {
}
void SetUp(void) {

View file

@ -26,7 +26,7 @@
#include "libc/thread/posixthread.internal.h"
#include "libc/thread/thread.h"
void OnUsr1(int sig, struct siginfo *si, void *vctx) {
void OnUsr1(int sig, siginfo_t *si, void *vctx) {
}
void SetUp(void) {