[Wayland-bugs] [Bug 766341] Do not rely on memfd as it requires a fairly recent kernel

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Mon May 16 18:32:39 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=766341

Ray Strode [halfline] <rstrode at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #327992|needs-work                  |none
             status|                            |
 Attachment #327992|0                           |1
        is obsolete|                            |

--- Comment #28 from Ray Strode [halfline] <rstrode at redhat.com> ---
Created attachment 328002
  --> https://bugzilla.gnome.org/attachment.cgi?id=328002&action=edit
wayland: fix error handling for memfd_create

We currently use syscall() directly to invoke memfd_create,
since the function isn't available in libc headers yet.

The code, though, mishandles how errors are passed from syscall().
It assumes syscall returns the error code directly (but negative),
when in fact, syscall() uses errno.

Also, the code fails to retry on EINTR.

This commit moves the handling of memfd create to a helper function,
and changes the code to use errno and handle EINTR.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160516/60bbb713/attachment.html>


More information about the wayland-bugs mailing list