فهرست منبع

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 4 سال پیش
والد
کامیت
65570216b4
1فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  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)