qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] win32: stop mixing SOCKET and file descriptor space


From: Paolo Bonzini
Subject: Re: [PATCH 3/4] win32: stop mixing SOCKET and file descriptor space
Date: Tue, 21 Feb 2023 11:52:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 2/21/23 11:40, Marc-André Lureau wrote:
Yes it likely can, the first SOCKET value starts at 92 in a simple
test. It looks like it may depend on the system number of opened
sockets.

I think the second big issue is that we have many places where we
assume a fd is a fd, and we simply call close() (which would result
in CloseHandle, but missing closesocket).

sigh, if the CRT would allow us to steal the handle back..

I found an interesting option here, using HANDLE_FLAG_PROTECT_FROM_CLOSE: https://github.com/ksmurph1/VulkanConfigurator/blob/986992a8b963a6b271785a77d5efd349b6e6ea4f/src/folly/src/net/detail/SocketFileDescriptorMap.cpp#L36
Wow, that's the ugliest thing ever but it seems to be made for this. :)

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]