mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 03:02:28 +00:00
Rewrite Windows connect()
Our old code wasn't working with projects like Qt that call connect() in O_NONBLOCK mode multiple times. This change overhauls connect() to use a simpler WSAConnect() API and follows the same pattern as cosmo accept(). This change also reduces the binary footprint of read(), which no longer needs to depend on our enormous clock_gettime() function.
This commit is contained in:
parent
5469202ea8
commit
e142124730
25 changed files with 556 additions and 277 deletions
|
@ -38,6 +38,7 @@
|
|||
#include "libc/nt/winsock.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/sock/sendfile.internal.h"
|
||||
#include "libc/sock/syscall_fd.internal.h"
|
||||
#include "libc/sock/wsaid.internal.h"
|
||||
#include "libc/stdio/sysparam.h"
|
||||
#include "libc/sysv/errfuns.h"
|
||||
|
@ -58,7 +59,7 @@ static void transmitfile_init(void) {
|
|||
g_transmitfile.lpTransmitFile = __get_wsaid(&TransmitfileGuid);
|
||||
}
|
||||
|
||||
static dontinline textwindows ssize_t sys_sendfile_nt(
|
||||
textwindows dontinline static ssize_t sys_sendfile_nt(
|
||||
int outfd, int infd, int64_t *opt_in_out_inoffset, uint32_t uptobytes) {
|
||||
ssize_t rc;
|
||||
uint32_t flags = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue