Use a glfw specific name for memfd_create
This commit is contained in:
parent
eeb4d3fe55
commit
8dfef58f29
2
glfw/backend_utils.c
vendored
2
glfw/backend_utils.c
vendored
@ -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
4
glfw/memfd.h
vendored
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user