summary refs log tree commit diff stats
path: root/include/sysemu/os-win32.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-21 16:47:51 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 15:23:37 +0400
commitf5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5 (patch)
tree20c527712fd1611992b572d4362a41011392349c /include/sysemu/os-win32.h
parent3ffef1a55ca3b55fa64d43cd35af5adb2c260463 (diff)
downloadfocaccia-qemu-f5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5.tar.gz
focaccia-qemu-f5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5.zip
win32/socket: introduce qemu_socket_select() helper
This is a wrapper for WSAEventSelect, with Error handling. By default,
it will produce a warning, so callers don't have to be modified
now, and yet we can spot potential mis-use.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20230221124802.4103554-7-marcandre.lureau@redhat.com>
Diffstat (limited to 'include/sysemu/os-win32.h')
-rw-r--r--include/sysemu/os-win32.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 97d0243aee..9f842ae643 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -29,6 +29,7 @@
 #include <winsock2.h>
 #include <windows.h>
 #include <ws2tcpip.h>
+#include "qemu/typedefs.h"
 
 #ifdef HAVE_AFUNIX_H
 #include <afunix.h>
@@ -164,6 +165,10 @@ static inline void qemu_funlockfile(FILE *f)
 #endif
 }
 
+/* Helper for WSAEventSelect, to report errors */
+bool qemu_socket_select(SOCKET s, WSAEVENT hEventObject,
+                        long lNetworkEvents, Error **errp);
+
 /* We wrap all the sockets functions so that we can
  * set errno based on WSAGetLastError()
  */