From 65570216b406f7f71c96ddbafb10ee766b1a8ee5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 20 Jan 2021 15:17:51 -0500 Subject: oss-fuzz: Try harder to fix build Apparently memfd_create() is newish in glibc, and oss-fuzz uses Ubuntu 16.04 as base for its docker images, which doens't yet have memfd_create(). But, not to worry, it does have the syscall define and that's all we really need :/ --- Userland/Libraries/LibCore/AnonymousBuffer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Userland') diff --git a/Userland/Libraries/LibCore/AnonymousBuffer.cpp b/Userland/Libraries/LibCore/AnonymousBuffer.cpp index d3087363b2..40853ff732 100644 --- a/Userland/Libraries/LibCore/AnonymousBuffer.cpp +++ b/Userland/Libraries/LibCore/AnonymousBuffer.cpp @@ -37,6 +37,16 @@ # include #endif +#if defined(__linux__) && !defined(MFD_CLOEXEC) +# include +# include + +static int memfd_create(const char* name, unsigned int flags) +{ + return syscall(SYS_memfd_create, name, flags); +} +#endif + namespace Core { AnonymousBuffer AnonymousBuffer::create_with_size(size_t size) -- cgit v1.2.3