Fix compilation on systems that dont have the memfd_create syscall

This commit is contained in:
Kovid Goyal
2018-10-03 10:56:47 +05:30
parent ac98b85157
commit 7750a461aa
3 changed files with 14 additions and 8 deletions

2
glfw/memfd.h vendored
View File

@@ -6,7 +6,7 @@
#pragma once
#if defined(__linux__)
#ifdef HAS_MEMFD_CREATE
#define _GNU_SOURCE
#include <unistd.h>

2
glfw/wl_window.c vendored
View File

@@ -140,7 +140,7 @@ static int
createAnonymousFile(off_t size)
{
int ret;
#if defined(__linux__)
#ifdef HAS_MEMFD_CREATE
int fd = memfd_create("glfw-shared", MFD_CLOEXEC | MFD_ALLOW_SEALING);
if (fd < 0) return -1;
// We can add this seal before calling posix_fallocate(), as the file