AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
AC_CHECK_FUNC([timespec_get], [DEFINES="$DEFINES -DHAVE_TIMESPEC_GET"])
+AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"])
AC_MSG_CHECKING([whether strtod has locale support])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
endif
endforeach
-foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get']
+foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif
#define ANV_MMAP_CLEANUP_INIT ((struct anv_mmap_cleanup){0})
+#ifndef HAVE_MEMFD_CREATE
static inline int
memfd_create(const char *name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
+#endif
static inline uint32_t
ilog2_round_up(uint32_t value)
#include "anv_private.h"
+#ifndef HAVE_MEMFD_CREATE
static inline int
memfd_create(const char *name, unsigned int flags)
{
return syscall(SYS_memfd_create, name, flags);
}
+#endif
uint32_t
anv_gem_create(struct anv_device *device, uint64_t size)