util: add note about event file descriptors on Windows

When using GNULIB with Winsock, libvirt will never see the normal HANDLE
objects, instead GNULIB guarantees that libvirt gets a C runtime file
descriptor. The GNULIB poll impl also expects to get C runtime file
descriptors rather than HANDLE objects. Document this behaviour so that
it is clear to applications providing event loop implementations if they
need Windows portability.

Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-12-18 16:46:07 +00:00
parent 7201a254a9
commit 0e09706844
3 changed files with 12 additions and 1 deletions

View File

@@ -67,6 +67,10 @@ typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaq
* listen for specific events. The same file handle can be registered
* multiple times provided the requested event sets are non-overlapping
*
* @fd will always be a C runtime file descriptor. On Windows
* the _get_osfhandle() method can be used if a HANDLE is required
* instead.
*
* If the opaque user data requires free'ing when the handle
* is unregistered, then a 2nd callback can be supplied for
* this purpose. This callback needs to be invoked from a clean stack.