sysdeps/managarm: Allow retrieval in sys_sigaction()
@@ -36,7 +36,6 @@ int sys_sigprocmask(int how, const sigset_t *set, sigset_t *retrieve) {
int sys_sigaction(int number, const struct sigaction *__restrict action,
struct sigaction *__restrict saved_action) {
SignalGuard sguard;
- __ensure(action);
// TODO: Respect restorer. __ensure(!(action->sa_flags & SA_RESTORER));
@@ -45,6 +44,8 @@ int sys_sigaction(int number, const struct sigaction *__restrict action,
managarm::posix::CntRequest<MemoryAllocator> req(getSysdepsAllocator());
req.set_request_type(managarm::posix::CntReqType::SIG_ACTION);
+ if(action) {
+ req.set_mode(1);
req.set_flags(action->sa_flags);
req.set_sig_number(number);
req.set_sig_mask(action->sa_mask);
@@ -54,6 +55,7 @@ int sys_sigaction(int number, const struct sigaction *__restrict action,
req.set_sig_handler(reinterpret_cast<uintptr_t>(action->sa_handler));
}
req.set_sig_restorer(reinterpret_cast<uintptr_t>(&__mlibc_signal_restore));
+ }
frigg::String<MemoryAllocator> ser(getSysdepsAllocator());
req.SerializeToString(&ser);
