Re: MinGW port usable
From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:52
Johannes Sixt wrote:
"H. Peter Anvin" wrote:quoted
Johannes Sixt wrote:quoted
(*) The reason is that on Windows read() and write() cannot operate on descriptors created by socket(). A work-around is to implement a (threaded) proxy, but that's almost the same as if netcat were used as GIT_PROXY_COMMAND.Actually, I believe it can for the NT series kernels (at least 2000 or later, not sure about the earlier ones), but not for the DOS-based ones. The trick is to use _open_osfhandle() to convert the file handle (a WinAPI construct) to a file descriptor (which in Windows is a construct of the C library.)I tried this, but it doesn't seem to work. I get an EINVAL at the first write() to the socket. I conclude that the things returned by socket() are not WinAPI file handles that are valid for WriteFile(). :(
Except they are (for NT-based Windows), so you're doing something goofy. This is a widely used construct, so it can't be that broken. -hpa