summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorJunior Rantila <junior.rantila@gmail.com>2022-01-09 06:14:43 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-01-09 11:16:00 +0330
commit7801e38af16ff7aa27bdac92baa7abfe6ae47c3c (patch)
treea6426aeb589c871794cd4f9f42a517b8438ef6df /Userland
parentc6f745de27810ce364df3a23716ed213ccd06e52 (diff)
downloadserenity-7801e38af16ff7aa27bdac92baa7abfe6ae47c3c.zip
LibCore: Add beep wrapper
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCore/System.cpp9
-rw-r--r--Userland/Libraries/LibCore/System.h1
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);