Files
banan-os/userspace/libraries/LibC/setjmp.cpp
Bananymous 1d6c08478d LibC: Fix sigsetjmp
the call from C sigsetjmp messed up rbp, now sigsetjmp is also written
in assembly.

I did not test the 32 bit code, just ported the tested 64 bit version
over :D
2025-08-21 02:52:49 +03:00

12 lines
319 B
C++

#include <setjmp.h>
#include <signal.h>
static_assert(sizeof(sigjmp_buf) == (_JMP_BUF_REGS + 1) * sizeof(long) + sizeof(sigset_t));
void siglongjmp(sigjmp_buf env, int val)
{
if (env[_JMP_BUF_REGS])
pthread_sigmask(SIG_SETMASK, reinterpret_cast<sigset_t*>(&env[_JMP_BUF_REGS + 1]), nullptr);
longjmp(env, val);
}