From 4bed2ef66b6fc1b7419eeb951d3b479a39fe5076 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sun, 10 Jul 2022 15:25:25 +0200 Subject: [PATCH] LibCore: Port System::anon_create to FreeBSD FreeBSD implements the Linux API, so this was very simple luckily. --- Userland/Libraries/LibCore/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 770569b987..711373277c 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -286,7 +286,7 @@ ErrorOr anon_create([[maybe_unused]] size_t size, [[maybe_unused]] int opti int fd = -1; #if defined(__serenity__) fd = ::anon_create(round_up_to_power_of_two(size, PAGE_SIZE), options); -#elif defined(__linux__) +#elif defined(__linux__) || defined(__FreeBSD__) // FIXME: Support more options on Linux. auto linux_options = ((options & O_CLOEXEC) > 0) ? MFD_CLOEXEC : 0; fd = memfd_create("", linux_options);