]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: introduce compat wrappers for Winsock2
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 8 Jan 2020 10:41:00 +0000 (10:41 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Jan 2020 10:01:16 +0000 (10:01 +0000)
commitb5c95d042bad6b46e5157e1479717d9550def3be
treea18eb8aef34df1bdf5790b81feb7ea5579df073a
parentf650e86703847af544762d02f79c70131ff7fbab
util: introduce compat wrappers for Winsock2

Windows sockets take a SOCKET HANDLE object instead of a
file descriptor. Wrap them in the same way that gnulib
does so that they use C runtime file descriptors.

While we could in theory use GSocket, it is hard to get
the exact same semantics libvirt has for its current
socket usage. Wrapping the Winsock2 APIs is thus the
easiest approach in the short term.

In changing the socke wrappers we need to re-implement
the nonblocking function too, since the GNULIB impl
expects to be used with the GNULIB sockets wrappers.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/Makefile.inc.am
src/util/virsocket.c [new file with mode: 0644]
src/util/virsocket.h [new file with mode: 0644]
src/util/virutil.c