Fix some more socket bugs

- The functions that return a sockaddr now do so the same way the Linux
  Kernel does across platforms, e.g. getpeername(), accept4()

- Socket system calls on Windows will now only check for interrupts when
  a blocking operation needs to be performed.

- Write tests for recvfrom() system call
This commit is contained in:
Justine Tunney 2023-07-23 16:31:10 -07:00
parent ac92f25296
commit 0ba3199915
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
49 changed files with 347 additions and 352 deletions

View file

@ -31,10 +31,9 @@ textwindows ssize_t sys_recvfrom_nt(struct Fd *fd, const struct iovec *iov,
uint32_t *opt_inout_srcaddrsize) {
int err;
ssize_t rc;
uint32_t got = -666;
uint32_t got;
struct SockFd *sockfd;
struct NtIovec iovnt[16];
if (_check_interrupts(true, g_fds.p)) return -1;
struct NtOverlapped overlapped = {.hEvent = WSACreateEvent()};
err = errno;
if (!WSARecvFrom(fd->handle, iovnt, __iovec2nt(iovnt, iov, iovlen), 0, &flags,