mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Support non-blocking i/o across platforms
This change introduces new tests for `O_NONBLOCK` and `SOCK_NONBLOCK` to confirm that non-blocking i/o is now working on all supported platforms, including Windows. For example, you can now say on Windows, MacOS, etc.: socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_TCP); To create a non-blocking IPv4 TCP socket. Or you can enable non-blocking i/o on an existing socket / pipe / etc. file descriptor by calling fcntl fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); This functionality is polyfilled on older Linux kernels too, e.g. RHEL5. Now that fcntl() support is much better the FIOCLEX / FIONCLEX polyfills for ioctl() have been removed since they're ugly non-POSIX diameond APIs This change fixes a weakness in kprintf() that was causing Windows trace tools to frequently crash.
This commit is contained in:
parent
5c9e03e3e0
commit
1d4eb08fa1
102 changed files with 678 additions and 331 deletions
|
@ -98,7 +98,6 @@ imp 'CallNamedPipeA' CallNamedPipeA kernel32 110 7
|
|||
imp 'CallbackMayRunLong' CallbackMayRunLong kernel32 0
|
||||
imp 'CancelDeviceWakeupRequest' CancelDeviceWakeupRequest kernel32 113
|
||||
imp 'CancelIo' CancelIo kernel32 0 1
|
||||
imp 'CancelIoEx' CancelIoEx kernel32 0 2
|
||||
imp 'CancelSynchronousIo' CancelSynchronousIo kernel32 0 1
|
||||
imp 'CancelTimerQueueTimer' CancelTimerQueueTimer kernel32 118
|
||||
imp 'CancelWaitableTimer' CancelWaitableTimer kernel32 0
|
||||
|
@ -1097,6 +1096,7 @@ imp 'WriteProfileString' WriteProfileStringW kernel32 1575
|
|||
imp 'WriteTapemark' WriteTapemark kernel32 1576
|
||||
imp 'ZombifyActCtx' ZombifyActCtx kernel32 0
|
||||
imp 'ZombifyActCtxWorker' ZombifyActCtxWorker kernel32 1578
|
||||
imp '__CancelIoEx' CancelIoEx kernel32 0 2
|
||||
imp '__CloseHandle' CloseHandle kernel32 0 1
|
||||
imp '__CreateDirectory' CreateDirectoryW kernel32 0 2
|
||||
imp '__CreateFile' CreateFileW kernel32 0 7
|
||||
|
@ -3228,7 +3228,6 @@ imp 'WSAEnumNetworkEvents' WSAEnumNetworkEvents ws2_32 64 3
|
|||
imp 'WSAEnumProtocols' WSAEnumProtocolsW ws2_32 66 3
|
||||
imp 'WSAEventSelect' WSAEventSelect ws2_32 67 3
|
||||
imp 'WSAGetLastError' WSAGetLastError ws2_32 111 0
|
||||
imp 'WSAGetOverlappedResult' WSAGetOverlappedResult ws2_32 68 5
|
||||
imp 'WSAGetQOSByName' WSAGetQOSByName ws2_32 69 3
|
||||
imp 'WSAGetServiceClassInfo' WSAGetServiceClassInfoW ws2_32 71 4
|
||||
imp 'WSAGetServiceClassNameByClassId' WSAGetServiceClassNameByClassIdW ws2_32 73 3
|
||||
|
@ -3329,6 +3328,7 @@ imp '__WSARecvFrom' WSARecvFrom ws2_32 93 9
|
|||
imp '__WSAWaitForMultipleEvents' WSAWaitForMultipleEvents ws2_32 124 5
|
||||
imp '__sys_recv_nt' recv ws2_32 16 4 # we're using WSARecvFrom()
|
||||
imp '__sys_send_nt' send ws2_32 19 4 # we're using WSASendTo()
|
||||
imp '__WSAGetOverlappedResult' WSAGetOverlappedResult ws2_32 68 5
|
||||
|
||||
# IPHLPAPI.DLL
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue