diff --git a/Tests/Kernel/fuzz-syscalls.cpp b/Tests/Kernel/fuzz-syscalls.cpp index 2b87aee000aa41..6a945a06f64a2f 100644 --- a/Tests/Kernel/fuzz-syscalls.cpp +++ b/Tests/Kernel/fuzz-syscalls.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -80,7 +81,7 @@ static void do_systematic_tests() static void randomize_from(size_t* buffer, size_t len, const Vector& values) { for (size_t i = 0; i < len; ++i) { - buffer[i] = values[arc4random_uniform(values.size())]; + buffer[i] = values[get_random_uniform(values.size())]; } } @@ -139,7 +140,7 @@ static void do_random_tests() } for (size_t i = 0; i < fuzz_syscall_count; ++i) { // Construct a nice syscall: - int syscall_fn = arc4random_uniform(Syscall::Function::__Count); + int syscall_fn = get_random_uniform(Syscall::Function::__Count); randomize_from(direct_sc_args, array_size(direct_sc_args), interesting_values); randomize_from(fake_sc_params, fake_params_count, interesting_values); diff --git a/Userland/Services/LookupServer/DNSName.cpp b/Userland/Services/LookupServer/DNSName.cpp index cb753f6ddb18d1..b4f13c6c522ae5 100644 --- a/Userland/Services/LookupServer/DNSName.cpp +++ b/Userland/Services/LookupServer/DNSName.cpp @@ -6,6 +6,7 @@ */ #include "DNSName.h" +#include #include #include @@ -64,7 +65,7 @@ void DNSName::randomize_case() for (char c : m_name) { // Randomize the 0x20 bit in every ASCII character. if (isalpha(c)) { - if (arc4random_uniform(2)) + if (get_random_uniform(2)) c |= 0x20; else c &= ~0x20; diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 52eb6a4752c7d3..c709c2ad40135c 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -194,7 +195,7 @@ Vector LookupServer::lookup(const DNSName& name, const String& namese { DNSPacket request; request.set_is_query(); - request.set_id(arc4random_uniform(UINT16_MAX)); + request.set_id(get_random_uniform(UINT16_MAX)); DNSName name_in_question = name; if (should_randomize_case == ShouldRandomizeCase::Yes) name_in_question.randomize_case(); diff --git a/Userland/Utilities/fortune.cpp b/Userland/Utilities/fortune.cpp index c3f207b6ca9ab4..a76563e3382661 100644 --- a/Userland/Utilities/fortune.cpp +++ b/Userland/Utilities/fortune.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -115,7 +116,7 @@ int main(int argc, char** argv) return 1; } - u32 i = arc4random_uniform(quotes.size()); + u32 i = get_random_uniform(quotes.size()); const auto& chosen_quote = quotes[i]; auto datetime = Core::DateTime::from_timestamp(chosen_quote.utc_time()); diff --git a/Userland/Utilities/shuf.cpp b/Userland/Utilities/shuf.cpp index f7668203d0f9ce..2833f7d38363ee 100644 --- a/Userland/Utilities/shuf.cpp +++ b/Userland/Utilities/shuf.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -38,7 +39,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) // Fisher-Yates shuffle String tmp; for (size_t i = lines.size() - 1; i >= 1; --i) { - size_t j = arc4random_uniform(i + 1); + size_t j = get_random_uniform(i + 1); // Swap i and j if (i == j) continue;