Changeset 268472 in webkit


Ignore:
Timestamp:
Oct 14, 2020 10:44:54 AM (4 years ago)
Author:
svillar@igalia.com
Message:

[GLIB] Fix linking error for systems not providing <sys/memfd.h>
https://bugs.webkit.org/show_bug.cgi?id=217514

Reviewed by Carlos Garcia Campos.

  • UIProcess/Launcher/glib/BubblewrapLauncher.cpp: Unconditionally check for <sys/mman.h> which should always exist instead

of <sys/memfd.h>. Also define the fallback with syscall() only for linux systems (as it requires <linux/memfd.h>).

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268458 r268472  
     12020-10-14  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [GLIB] Fix linking error for systems not providing <sys/memfd.h>
     4        https://bugs.webkit.org/show_bug.cgi?id=217514
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: Unconditionally check for <sys/mman.h> which should always exist instead
     9        of <sys/memfd.h>. Also define the fallback with syscall() only for linux systems (as it requires <linux/memfd.h>).
     10
    1112020-10-14  Kate Cheney  <katherine_cheney@apple.com>
    212
  • trunk/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp

    r265753 r268472  
    4141#endif
    4242
    43 #if __has_include(<sys/memfd.h>)
    44 
    45 #include <sys/memfd.h>
    46 
    47 #else
     43#include <sys/mman.h>
     44
     45#ifndef MFD_ALLOW_SEALING
     46
     47#if HAVE(LINUX_MEMFD_H)
     48
     49#include <linux/memfd.h>
    4850
    4951// These defines were added in glibc 2.27, the same release that added memfd_create.
     
    6062#define F_SEAL_WRITE  0x0008
    6163
    62 #define MFD_ALLOW_SEALING 2U
    63 
    6464static int memfd_create(const char* name, unsigned flags)
    6565{
    6666    return syscall(__NR_memfd_create, name, flags);
    6767}
    68 #endif
     68#endif // #if HAVE(LINUX_MEMFD_H)
     69
     70#endif // #ifndef MFD_ALLOW_SEALING
    6971
    7072namespace WebKit {
Note: See TracChangeset for help on using the changeset viewer.