From 11f1c3c4ff30ddf97de052668e42f10185d47e31 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 4 Oct 2024 13:04:28 +0200 Subject: Return the correct errno when mmap can't allocated hinted memory address --- src/wrapped/wrappedlibc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index abb4cd26..3c820289 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -3015,6 +3015,8 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, size_t length, int prot, int f setProtection_mmap((uintptr_t)ret, length, prot); else setProtection((uintptr_t)ret, length, prot); + if(old_addr && ret!=old_addr) + errno = EEXIST; } return ret; } -- cgit 1.4.1