From: Michal Privoznik <mpriv...@redhat.com>

Not every OS is capable of madvise() or posix_madvise() even. In
that case, errno should be set to ENOSYS as it reflects the cause
better.

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Reviewed-by: David Hildenbrand <da...@redhat.com>
Message-ID: 
<b381c23bd8f413f1453a2c1a66e0979beaf27433.1717584048.git.mpriv...@redhat.com>
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
 util/osdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/osdep.c b/util/osdep.c
index e42f4e8121d..5d23bbfbec4 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -64,7 +64,7 @@ int qemu_madvise(void *addr, size_t len, int advice)
     }
     return 0;
 #else
-    errno = EINVAL;
+    errno = ENOSYS;
     return -1;
 #endif
 }
-- 
2.45.1


Reply via email to