LibSystem: Add ErrorOr<T> wrapper for sigaction() :^)

This commit is contained in:
Andreas Kling 2021-11-22 16:11:03 +01:00
parent 843262497a
commit 3d34216b9a
Notes: sideshowbarker 2024-07-18 00:52:41 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -35,4 +35,10 @@ ErrorOr<void> unveil(StringView path, StringView permissions)
HANDLE_SYSCALL_RETURN_VALUE("unveil"sv, rc);
}
ErrorOr<void> sigaction(int signal, struct sigaction const* action, struct sigaction* old_action)
{
int rc = syscall(SC_sigaction, signal, action, old_action);
HANDLE_SYSCALL_RETURN_VALUE("sigaction"sv, rc);
}
}

View file

@ -7,10 +7,12 @@
#pragma once
#include <AK/Error.h>
#include <signal.h>
namespace System {
ErrorOr<void> pledge(StringView promises, StringView execpromises);
ErrorOr<void> unveil(StringView path, StringView permissions);
ErrorOr<void> sigaction(int signal, struct sigaction const* action, struct sigaction* old_action);
}