Procházet zdrojové kódy

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 :/
Nico Weber před 4 roky
rodič
revize
65570216b4
1 změnil soubory, kde provedl 10 přidání a 0 odebrání
  1. 10 0
      Userland/Libraries/LibCore/AnonymousBuffer.cpp

+ 10 - 0
Userland/Libraries/LibCore/AnonymousBuffer.cpp

@@ -37,6 +37,16 @@
 #    include <serenity.h>
 #endif
 
+#if defined(__linux__) && !defined(MFD_CLOEXEC)
+#    include <linux/memfd.h>
+#    include <sys/syscall.h>
+
+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)