Use a glfw specific name for memfd_create

This commit is contained in:
Kovid Goyal 2021-07-20 21:48:22 +05:30
parent eeb4d3fe55
commit 8dfef58f29
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -375,7 +375,7 @@ GLFWAPI char* utf_8_strndup(const char* source, size_t max_length) {
int createAnonymousFile(off_t size) { int createAnonymousFile(off_t size) {
int ret, fd = -1, shm_anon = 0; int ret, fd = -1, shm_anon = 0;
#ifdef HAS_MEMFD_CREATE #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; if (fd < 0) return -1;
// We can add this seal before calling posix_fallocate(), as the file // We can add this seal before calling posix_fallocate(), as the file
// is currently zero-sized anyway. // is currently zero-sized anyway.

4
glfw/memfd.h vendored
View File

@ -10,8 +10,8 @@
#include <unistd.h> #include <unistd.h>
#include <sys/syscall.h> #include <sys/syscall.h>
static inline int memfd_create(const char *name, unsigned int flags) { static inline int glfw_memfd_create(const char *name, unsigned int flags) {
return syscall(__NR_memfd_create, name, flags); return (int)syscall(__NR_memfd_create, name, flags);
} }
#ifndef F_LINUX_SPECIFIC_BASE #ifndef F_LINUX_SPECIFIC_BASE