diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-20 17:36:41 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-21 11:16:03 +0400 |
commit | f3ab43accf65724c8b97550369fc21a2e652348d (patch) | |
tree | fd8bb6920514361407c29c02de83052f1c145d2a /include/sysemu/os-win32.h | |
parent | aa9e7fa4689d1becb2faf67f65aafcbcf664f1ce (diff) |
win32: add qemu_close_socket_osfhandle()
Close the given file descriptor, but returns the underlying SOCKET.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230320133643.1618437-2-marcandre.lureau@redhat.com>
Diffstat (limited to 'include/sysemu/os-win32.h')
-rw-r--r-- | include/sysemu/os-win32.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index e2849f88ab..15c296e0eb 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -171,10 +171,21 @@ bool qemu_socket_select(int sockfd, WSAEVENT hEventObject, bool qemu_socket_unselect(int sockfd, Error **errp); -/* We wrap all the sockets functions so that we can - * set errno based on WSAGetLastError() +/* We wrap all the sockets functions so that we can set errno based on + * WSAGetLastError(), and use file-descriptors instead of SOCKET. */ +/* + * qemu_close_socket_osfhandle: + * @fd: a file descriptor associated with a SOCKET + * + * Close only the C run-time file descriptor, leave the SOCKET opened. + * + * Returns zero on success. On error, -1 is returned, and errno is set to + * indicate the error. + */ +int qemu_close_socket_osfhandle(int fd); + #undef close #define close qemu_close_wrap int qemu_close_wrap(int fd); |