Improve threading and i/o routines

- On Windows connect() can now be interrupted by a signal; connect() w/
  O_NONBLOCK will now raise EINPROGRESS; and connect() with SO_SNDTIMEO
  will raise ETIMEDOUT after the interval has elapsed.

- We now get the AcceptEx(), ConnectEx(), and TransmitFile() functions
  from the WIN32 API the officially blessed way, using WSAIoctl().

- Do nothing on Windows when fsync() is called on a directory handle.
  This was raising EACCES earlier becaues GENERIC_WRITE is required on
  the handle. It's possible to FlushFileBuffers() a directory handle if
  it's opened with write access but MSDN doesn't document what it does.
  If you have any idea, please let us know!

- Prefer manual reset event objects for read() and write() on Windows.

- Do some code cleanup on our dlmalloc customizations.

- Fix errno type error in Windows blocking routines.

- Make the futex polyfill simpler and faster.
This commit is contained in:
Justine Tunney 2023-10-12 18:53:17 -07:00
parent f7343319cc
commit 49b0eaa69f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
43 changed files with 528 additions and 425 deletions

View file

@ -483,15 +483,6 @@ imp 'GetSaveFileName' GetSaveFileNameW comdlg32 1
imp 'PrintDlg' PrintDlgW comdlg32 1
imp 'ReplaceText' ReplaceTextW comdlg32 1
# MSWSOCK.DLL
#
# Name Actual DLL Arity
imp 'AcceptEx' AcceptEx MsWSock 8
imp 'DisconnectEx' DisconnectEx MsWSock 4
imp 'GetAcceptExSockaddrs' GetAcceptExSockaddrs MsWSock 8
imp 'TransmitFile' TransmitFile MsWSock 7
imp 'WSARecvEx' WSARecvEx MsWSock 4
# WS2_32.DLL
#
# Name Actual DLL Arity
@ -516,6 +507,7 @@ imp '' setsockopt ws2_32 5
imp '' shutdown ws2_32 2
imp '' socket ws2_32 3
imp '' socket ws2_32 3
imp '' socket ws2_32 3
imp 'FreeAddrInfo' FreeAddrInfoW ws2_32 1
imp 'FreeAddrInfoEx' FreeAddrInfoExW ws2_32 1
imp 'GetAddrInfo' GetAddrInfoW ws2_32 4