mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibSystem: Add ErrorOr<T> wrapper for sigaction() :^)
This commit is contained in:
parent
843262497a
commit
3d34216b9a
Notes:
sideshowbarker
2024-07-18 00:52:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3d34216b9a3
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue