From 210b7b2b3cdef01a15ebabf02dd1a9d8a51743ba Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 5 Jun 2024 12:44:56 +0200 Subject: osdep: Make qemu_madvise() return ENOSYS on unsupported OSes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Message-ID: Signed-off-by: Paolo Bonzini --- util/osdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/osdep.c b/util/osdep.c index e42f4e8..5d23bbf 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 } -- cgit v1.1