mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Favor siginfo_t over struct siginfo
This commit is contained in:
parent
c638eabfe0
commit
deaef81463
20 changed files with 37 additions and 39 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue