[webkit-reviews] review denied: [Bug 217514] [GLIB] Fix linking error for systems not providing <sys/memfd.h> : [Attachment 410931] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 9 05:19:38 PDT 2020


Adrian Perez <aperez at igalia.com> has denied  review:
Bug 217514: [GLIB] Fix linking error for systems not providing <sys/memfd.h>
https://bugs.webkit.org/show_bug.cgi?id=217514

Attachment 410931: Patch

https://bugs.webkit.org/attachment.cgi?id=410931&action=review




--- Comment #4 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 410931
  --> https://bugs.webkit.org/attachment.cgi?id=410931
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410931&action=review

I think there is a better approach, as outlined below.

> Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp:45
>  #include <sys/memfd.h>

It seems that there was a mistake in the manual pages for memfd_create,
and it was never intended for it to suggest using <sys/memfd.h>. There is
some discussion about that here.

 
https://stackoverflow.com/questions/56615488/getting-gcc-error-sys-memfd-h-no-s
uch-file-or-directory

> Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp:49
> +#include <sys/mman.h>

The <sys/mman.h> header always exists, we do not need to check whether it's
available.
What we can do is:

  1. Always include <sys/mman.h>. This also works for other systems, for
example
     FreeBSD also has a memfd_create() function defined in this header:
    
https://github.com/freebsd/freebsd/commit/575e351fdd996f72921b87e71c2c26466e887
ed2

  2. If the MFD_* macros are not defined, include <linux/memfd.h> and use
syscall2()
     Note: Use this fall only for linux, e.g. with a
__has_include(<linux/memfd.h>) guard.


More information about the webkit-reviews mailing list