From e5794429475e9c479904cd20da5283b5de30d4c2 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 31 May 2022 20:35:06 +0200 Subject: [PATCH] Make this backwards compatible with older Linux kernels --- libpcsxcore/lightrec/mem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libpcsxcore/lightrec/mem.c b/libpcsxcore/lightrec/mem.c index c7fa7da7..c3a1421e 100644 --- a/libpcsxcore/lightrec/mem.c +++ b/libpcsxcore/lightrec/mem.c @@ -3,6 +3,7 @@ * Copyright (C) 2022 Paul Cercueil */ +#define _GNU_SOURCE #include #include #include @@ -11,6 +12,7 @@ #include #include #include +#include #include #include "../psxhw.h" @@ -68,7 +70,8 @@ static int lightrec_mmap_ram(bool hugetlb) if (hugetlb) flags |= MFD_HUGETLB; - memfd = memfd_create("/lightrec_memfd", flags); + memfd = syscall(SYS_memfd_create, "/lightrec_memfd", + flags); if (memfd < 0) { err = -errno; fprintf(stderr, "Failed to create memfd: %d\n", err); @@ -124,9 +127,7 @@ int lightrec_init_mmap(void) unsigned int i; uintptr_t base; void *map; - int err; - - err = lightrec_mmap_ram(true); + int err = lightrec_mmap_ram(true); if (err) { err = lightrec_mmap_ram(false); if (err) { -- 2.39.5