From 8dfef58f292dce21f979fd981e7f3c625e708ed7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jul 2021 21:48:22 +0530 Subject: [PATCH] Use a glfw specific name for memfd_create --- glfw/backend_utils.c | 2 +- glfw/memfd.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glfw/backend_utils.c b/glfw/backend_utils.c index 546f539fa..a2651c3d6 100644 --- a/glfw/backend_utils.c +++ b/glfw/backend_utils.c @@ -375,7 +375,7 @@ GLFWAPI char* utf_8_strndup(const char* source, size_t max_length) { int createAnonymousFile(off_t size) { int ret, fd = -1, shm_anon = 0; #ifdef HAS_MEMFD_CREATE - fd = memfd_create("glfw-shared", MFD_CLOEXEC | MFD_ALLOW_SEALING); + fd = glfw_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 // is currently zero-sized anyway. diff --git a/glfw/memfd.h b/glfw/memfd.h index 9afc0db93..4f2edf14a 100644 --- a/glfw/memfd.h +++ b/glfw/memfd.h @@ -10,8 +10,8 @@ #include #include -static inline int memfd_create(const char *name, unsigned int flags) { - return syscall(__NR_memfd_create, name, flags); +static inline int glfw_memfd_create(const char *name, unsigned int flags) { + return (int)syscall(__NR_memfd_create, name, flags); } #ifndef F_LINUX_SPECIFIC_BASE