core: handle sigaction on Windows

This commit is contained in:
Gabriel Ferreira
2022-10-08 21:15:21 -03:00
parent 10673c56e9
commit 529d30b0da

View File

@@ -27,6 +27,39 @@
#include <iostream>
#include <list>
#ifdef __WIN32__
struct sigaction
{
void (*sa_handler)(int);
int sa_flags;
int sa_mask;
};
int
sigaction(int sig, struct sigaction* action, struct sigaction* old)
{
if (sig == -1)
{
return 0;
}
if (old == nullptr)
{
if (signal(sig, SIG_DFL) == SIG_ERR)
{
return -1;
}
}
else
{
if (signal(sig, action->sa_handler) == SIG_ERR)
{
return -1;
}
}
return 0;
}
#endif
/**
* \file
* \ingroup fatalimpl