From: libretroadmin Date: Tue, 31 May 2022 18:35:06 +0000 (+0200) Subject: Make this backwards compatible with older Linux kernels X-Git-Tag: r24l~466 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5794429475e9c479904cd20da5283b5de30d4c2;p=pcsx_rearmed.git Make this backwards compatible with older Linux kernels --- 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) {