diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-02-21 16:47:51 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-13 15:23:37 +0400 |
commit | f5fd677ae7cf7cfb07b12adbfd479c460ddc3ac5 (patch) | |
tree | 20c527712fd1611992b572d4362a41011392349c /include/sysemu/os-win32.h | |
parent | 3ffef1a55ca3b55fa64d43cd35af5adb2c260463 (diff) |
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.h | 5 |
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() */ |