2023-05-02 02:43:59 +00:00
|
|
|
#include "libc/nt/codegen.h"
|
2020-06-15 14:18:57 +00:00
|
|
|
.imp ws2_32,__imp_WSAGetOverlappedResult,WSAGetOverlappedResult,68
|
|
|
|
|
|
|
|
.text.windows
|
2023-06-06 06:35:31 +00:00
|
|
|
.ftrace1
|
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.
2023-07-23 09:56:47 +00:00
|
|
|
__WSAGetOverlappedResult:
|
2023-06-06 06:35:31 +00:00
|
|
|
.ftrace2
|
2023-05-09 08:56:56 +00:00
|
|
|
#ifdef __x86_64__
|
2020-06-15 14:18:57 +00:00
|
|
|
push %rbp
|
|
|
|
mov %rsp,%rbp
|
|
|
|
mov __imp_WSAGetOverlappedResult(%rip),%rax
|
|
|
|
jmp __sysv2nt6
|
2023-05-09 08:56:56 +00:00
|
|
|
#elif defined(__aarch64__)
|
|
|
|
mov x0,#0
|
|
|
|
ret
|
|
|
|
#endif
|
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.
2023-07-23 09:56:47 +00:00
|
|
|
.endfn __WSAGetOverlappedResult,globl
|
2020-06-15 14:18:57 +00:00
|
|
|
.previous
|