Changeset View
Changeset View
Standalone View
Standalone View
graphics/mesa-dri/files/patch-src_intel_tools_aub__mem.c
- This file was moved from graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c.
- Partially implement memfd_create() via mkostemp() | - Partially implement memfd_create() via mkostemp() | ||||
--- src/intel/tools/aubinator.c.orig 2018-08-02 15:41:20 UTC | --- src/intel/tools/aub_mem.c.orig 2018-11-06 16:16:02 UTC | ||||
+++ src/intel/tools/aubinator.c | +++ src/intel/tools/aub_mem.c | ||||
@@ -52,7 +52,29 @@ | @@ -30,11 +30,34 @@ | ||||
#ifndef HAVE_MEMFD_CREATE | |||||
#include <sys/syscall.h> | |||||
+#include <fcntl.h> | |||||
static inline int | static inline int | ||||
memfd_create(const char *name, unsigned int flags) | memfd_create(const char *name, unsigned int flags) | ||||
{ | { | ||||
+#if defined(__linux__) | +#if defined(__linux__) | ||||
return syscall(SYS_memfd_create, name, flags); | return syscall(SYS_memfd_create, name, flags); | ||||
+#elif defined(__FreeBSD__) | +#elif defined(__FreeBSD__) | ||||
+ return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600); | + return shm_open(SHM_ANON, flags | O_RDWR | O_CREAT, 0600); | ||||
+#else /* DragonFly, NetBSD, OpenBSD, Solaris */ | +#else /* DragonFly, NetBSD, OpenBSD, Solaris */ | ||||
Show All 21 Lines |