From 2d94e30988575caf9cce028d5b4a305b75c21d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20C=2E=20Fran=C3=A7a?= Date: Mon, 3 Apr 2023 10:58:50 -0300 Subject: [PATCH] Fix clang/mingw - missing getpagesize Based on msys2-packages patch: https://github.com/msys2/MINGW-packages/pull/10543 --- qemu/util/oslib-posix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qemu/util/oslib-posix.c b/qemu/util/oslib-posix.c index e480e101..3402e1d1 100644 --- a/qemu/util/oslib-posix.c +++ b/qemu/util/oslib-posix.c @@ -45,6 +45,16 @@ static void *qemu_ram_mmap(struct uc_struct *uc, static void qemu_ram_munmap(struct uc_struct *uc, void *ptr, size_t size); #endif +#if defined(__MINGW32__) && defined(__clang__) +#include +int getpagesize() +{ + SYSTEM_INFO S; + GetNativeSystemInfo(&S); + return S.dwPageSize; +} +#endif + void *qemu_oom_check(void *ptr) { if (ptr == NULL) {