Skip to content

Commit

Permalink
Use a glfw specific name for memfd_create
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jul 20, 2021
1 parent eeb4d3f commit 8dfef58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion glfw/backend_utils.c
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions glfw/memfd.h
Expand Up @@ -10,8 +10,8 @@

#include <unistd.h>
#include <sys/syscall.h>
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
Expand Down

0 comments on commit 8dfef58

Please sign in to comment.