From c5709c0aed02cf7c7c5cda914d9794ac5cab55e7 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 20 Jan 2021 11:03:34 -0500 Subject: [PATCH] LibCore: Try to fix fuzzer build This might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29675 See also `man memfd_create`. --- Userland/Libraries/LibCore/AnonymousBuffer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibCore/AnonymousBuffer.cpp b/Userland/Libraries/LibCore/AnonymousBuffer.cpp index d3087363b2..6caeb22e5d 100644 --- a/Userland/Libraries/LibCore/AnonymousBuffer.cpp +++ b/Userland/Libraries/LibCore/AnonymousBuffer.cpp @@ -24,6 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if defined(__linux__) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE // For memfd_create, MFD_CLOEXEC +#endif + #include #include #include