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