diff options
author | Junior Rantila <junior.rantila@gmail.com> | 2022-01-09 06:14:43 +0100 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-01-09 11:16:00 +0330 |
commit | 7801e38af16ff7aa27bdac92baa7abfe6ae47c3c (patch) | |
tree | a6426aeb589c871794cd4f9f42a517b8438ef6df /Userland | |
parent | c6f745de27810ce364df3a23716ed213ccd06e52 (diff) | |
download | serenity-7801e38af16ff7aa27bdac92baa7abfe6ae47c3c.zip |
LibCore: Add beep wrapper
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibCore/System.cpp | 9 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/System.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 7a9df33728..c0b73dbbd5 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -26,6 +26,15 @@ namespace Core::System { #ifdef __serenity__ + +ErrorOr<void> beep() +{ + auto rc = ::sysbeep(); + if (rc < 0) + return Error::from_syscall("beep", rc); + return {}; +} + ErrorOr<void> pledge(StringView promises, StringView execpromises) { Syscall::SC_pledge_params params { diff --git a/Userland/Libraries/LibCore/System.h b/Userland/Libraries/LibCore/System.h index 8a3a414860..40a1d0d888 100644 --- a/Userland/Libraries/LibCore/System.h +++ b/Userland/Libraries/LibCore/System.h @@ -30,6 +30,7 @@ namespace Core::System { #ifdef __serenity__ +ErrorOr<void> beep(); ErrorOr<void> pledge(StringView promises, StringView execpromises = {}); ErrorOr<void> unveil(StringView path, StringView permissions); ErrorOr<void> sendfd(int sockfd, int fd); |