mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 19:28:29 +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
|
@ -421,7 +421,7 @@ static int __sigaction(int sig, const struct sigaction *act,
|
|||
* ctx->uc_mcontext.rip += xedd.length;
|
||||
* }
|
||||
*
|
||||
* void OnCrash(int sig, struct siginfo *si, void *vctx) {
|
||||
* void OnCrash(int sig, siginfo_t *si, void *vctx) {
|
||||
* struct ucontext *ctx = vctx;
|
||||
* SkipOverFaultingInstruction(ctx);
|
||||
* ContinueOnCrash(); // reinstall here in case *rip faults
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#ifdef __x86_64__
|
||||
|
||||
privileged void __sigenter_wsl(int sig, struct siginfo *info, ucontext_t *ctx) {
|
||||
privileged void __sigenter_wsl(int sig, siginfo_t *info, ucontext_t *ctx) {
|
||||
int rva, flags;
|
||||
rva = __sighandrvas[sig];
|
||||
if (rva >= kSigactionMinRva) {
|
||||
|
|
|
@ -43,7 +43,7 @@ privileged void __sigenter_netbsd(int sig, struct siginfo_netbsd *si,
|
|||
CheckLargeStackAllocation(&uc, sizeof(uc));
|
||||
#pragma GCC pop_options
|
||||
int rva, flags;
|
||||
struct siginfo si2;
|
||||
siginfo_t si2;
|
||||
rva = __sighandrvas[sig];
|
||||
if (rva >= kSigactionMinRva) {
|
||||
flags = __sighandflags[sig];
|
||||
|
|
|
@ -41,7 +41,7 @@ privileged void __sigenter_openbsd(int sig, struct siginfo_openbsd *openbsdinfo,
|
|||
#pragma GCC diagnostic ignored "-Wframe-larger-than="
|
||||
struct Goodies {
|
||||
ucontext_t uc;
|
||||
struct siginfo si;
|
||||
siginfo_t si;
|
||||
} g;
|
||||
CheckLargeStackAllocation(&g, sizeof(g));
|
||||
#pragma GCC pop_options
|
||||
|
|
|
@ -21,8 +21,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
|
||||
privileged void __siginfo2cosmo(struct siginfo *si,
|
||||
const union siginfo_meta *m) {
|
||||
privileged void __siginfo2cosmo(siginfo_t *si, const union siginfo_meta *m) {
|
||||
void *si_addr;
|
||||
int32_t si_signo;
|
||||
int32_t si_errno;
|
||||
|
@ -93,7 +92,7 @@ privileged void __siginfo2cosmo(struct siginfo *si,
|
|||
}
|
||||
}
|
||||
|
||||
*si = (struct siginfo){0};
|
||||
*si = (siginfo_t){0};
|
||||
si->si_signo = si_signo;
|
||||
si->si_errno = si_errno;
|
||||
si->si_code = si_code;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
COSMOPOLITAN_C_START_
|
||||
|
||||
typedef void (*sighandler_t)(int);
|
||||
typedef void (*sigaction_f)(int, struct siginfo *, void *);
|
||||
typedef void (*sigaction_f)(int, siginfo_t *, void *);
|
||||
|
||||
struct sigaction {
|
||||
union {
|
||||
|
|
|
@ -60,11 +60,11 @@ union metasigaction {
|
|||
struct sigaction_xnu_out xnu_out;
|
||||
};
|
||||
|
||||
void __sigenter_xnu(int, struct siginfo *, void *);
|
||||
void __sigenter_wsl(int, struct siginfo *, void *);
|
||||
void __sigenter_netbsd(int, struct siginfo *, void *);
|
||||
void __sigenter_freebsd(int, struct siginfo *, void *);
|
||||
void __sigenter_openbsd(int, struct siginfo *, void *);
|
||||
void __sigenter_xnu(int, siginfo_t *, void *);
|
||||
void __sigenter_wsl(int, siginfo_t *, void *);
|
||||
void __sigenter_netbsd(int, siginfo_t *, void *);
|
||||
void __sigenter_freebsd(int, siginfo_t *, void *);
|
||||
void __sigenter_openbsd(int, siginfo_t *, void *);
|
||||
|
||||
const char *DescribeSigaction(char[256], int, const struct sigaction *);
|
||||
#define DescribeSigaction(rc, sa) DescribeSigaction(alloca(256), rc, sa)
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
COSMOPOLITAN_C_START_
|
||||
|
||||
union siginfo_meta {
|
||||
struct siginfo linux;
|
||||
siginfo_t linux;
|
||||
struct siginfo_xnu xnu;
|
||||
struct siginfo_freebsd freebsd;
|
||||
struct siginfo_openbsd openbsd;
|
||||
struct siginfo_netbsd netbsd;
|
||||
};
|
||||
|
||||
void __siginfo2cosmo(struct siginfo *, const union siginfo_meta *);
|
||||
void __siginfo2cosmo(siginfo_t *, const union siginfo_meta *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_SIGINFO_META_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue