mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 07:25:26 +00:00
[rpcsx-os] Attempt to fix crash for gcc-12
This commit is contained in:
parent
3c3fcaaea4
commit
7c45d9bb90
3 changed files with 33 additions and 16 deletions
|
|
@ -84,6 +84,22 @@ handle_signal(int sig, siginfo_t *info, void *ucontext) {
|
|||
}
|
||||
|
||||
static void setupSigHandlers() {
|
||||
stack_t ss;
|
||||
|
||||
ss.ss_sp = malloc(SIGSTKSZ);
|
||||
if (ss.ss_sp == NULL) {
|
||||
perror("malloc");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ss.ss_size = SIGSTKSZ;
|
||||
ss.ss_flags = 0;
|
||||
|
||||
if (sigaltstack(&ss, NULL) == -1) {
|
||||
perror("sigaltstack");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
struct sigaction act {};
|
||||
act.sa_sigaction = handle_signal;
|
||||
act.sa_flags = SA_SIGINFO | SA_ONSTACK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue