summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/beep.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls/beep.cpp')
-rw-r--r--Kernel/Syscalls/beep.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Kernel/Syscalls/beep.cpp b/Kernel/Syscalls/beep.cpp
index 3e2453107f..c8a897a756 100644
--- a/Kernel/Syscalls/beep.cpp
+++ b/Kernel/Syscalls/beep.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <Kernel/CommandLine.h>
#include <Kernel/Devices/PCSpeaker.h>
#include <Kernel/Process.h>
@@ -12,6 +13,8 @@ namespace Kernel {
ErrorOr<FlatPtr> Process::sys$beep()
{
VERIFY_NO_PROCESS_BIG_LOCK(this);
+ if (!kernel_command_line().is_pc_speaker_enabled())
+ return ENODEV;
PCSpeaker::tone_on(440);
auto result = Thread::current()->sleep(Time::from_nanoseconds(200'000'000));
PCSpeaker::tone_off();