cosmopolitan/libc/sock
Justine Tunney 791f79fcb3
Make improvements
- We now serialize the file descriptor table when spawning / executing
  processes on Windows. This means you can now inherit more stuff than
  just standard i/o. It's needed by bash, which duplicates the console
  to file descriptor #255. We also now do a better job serializing the
  environment variables, so you're less likely to encounter E2BIG when
  using your bash shell. We also no longer coerce environ to uppercase

- execve() on Windows now remotely controls its parent process to make
  them spawn a replacement for itself. Then it'll be able to terminate
  immediately once the spawn succeeds, without having to linger around
  for the lifetime as a shell process for proxying the exit code. When
  process worker thread running in the parent sees the child die, it's
  given a handle to the new child, to replace it in the process table.

- execve() and posix_spawn() on Windows will now provide CreateProcess
  an explicit handle list. This allows us to remove handle locks which
  enables better fork/spawn concurrency, with seriously correct thread
  safety. Other codebases like Go use the same technique. On the other
  hand fork() still favors the conventional WIN32 inheritence approach
  which can be a little bit messy, but is *controlled* by guaranteeing
  perfectly clean slates at both the spawning and execution boundaries

- sigset_t is now 64 bits. Having it be 128 bits was a mistake because
  there's no reason to use that and it's only supported by FreeBSD. By
  using the system word size, signal mask manipulation on Windows goes
  very fast. Furthermore @asyncsignalsafe funcs have been rewritten on
  Windows to take advantage of signal masking, now that it's much more
  pleasant to use.

- All the overlapped i/o code on Windows has been rewritten for pretty
  good signal and cancelation safety. We're now able to ensure overlap
  data structures are cleaned up so long as you don't longjmp() out of
  out of a signal handler that interrupted an i/o operation. Latencies
  are also improved thanks to the removal of lots of "busy wait" code.
  Waits should be optimal for everything except poll(), which shall be
  the last and final demon we slay in the win32 i/o horror show.

- getrusage() on Windows is now able to report RUSAGE_CHILDREN as well
  as RUSAGE_SELF, thanks to aggregation in the process manager thread.
2023-10-08 08:59:53 -07:00
..
struct Make improvements 2023-10-08 08:59:53 -07:00
accept-nt.c Make improvements 2023-10-08 08:59:53 -07:00
accept.c Make improvements 2023-10-08 08:59:53 -07:00
accept4-sysv.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
accept4.c Make improvements 2023-10-08 08:59:53 -07:00
alg.h Perform build and magnum tuning 2021-08-10 10:26:13 -07:00
asanmsghdr.c Make considerably more progress on AARCH64 2023-05-12 22:42:57 -07:00
basesocket.c Improve synchronization 2022-04-15 15:31:55 -07:00
bind-nt.c Make improvements 2023-10-08 08:59:53 -07:00
bind-sysv.c Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
bind.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
closesocket-nt.c Make improvements 2023-10-08 08:59:53 -07:00
connect-nt.c Make improvements 2023-10-08 08:59:53 -07:00
connect-sysv.c Reduce build graph by another eight percent 2022-08-13 13:11:56 -07:00
connect.c Make improvements 2023-10-08 08:59:53 -07:00
epoll.c Make improvements 2023-10-08 08:59:53 -07:00
epoll.h Port a lot more code to AARCH64 2023-05-14 09:37:26 -07:00
fixupnewsockfd.c Support non-blocking i/o across platforms 2023-07-23 02:56:47 -07:00
gethostips.c Make the Windows Console work better 2023-09-07 18:27:22 -07:00
getsockname.c Make improvements 2023-10-08 08:59:53 -07:00
getsockopt-nt.c Make improvements 2023-10-08 08:59:53 -07:00
getsockopt.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
goodsocket.c Mint APE Loader v1.4 2023-07-25 05:48:08 -07:00
goodsocket.internal.h Refactor out some duplicated code 2021-08-14 06:17:56 -07:00
inet_addr.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
inet_aton.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
inet_ntoa.c Prove that Makefile is fully defined 2022-08-06 04:05:08 -07:00
inet_ntop.c Fix warnings 2023-09-01 20:50:18 -07:00
inet_pton.c Fix warnings 2023-09-01 20:50:18 -07:00
internal.h Make improvements 2023-10-08 08:59:53 -07:00
iovec2nt.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
ipclassify.internal.h Get Cosmopolitan into releasable state 2020-11-25 08:19:00 -08:00
kntwsadata.c Make improvements 2023-09-18 21:04:47 -07:00
listen-nt.c Make improvements 2023-10-08 08:59:53 -07:00
listen.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
overlapped.internal.h Make improvements 2023-10-08 08:59:53 -07:00
pselect.c Make improvements 2023-10-08 08:59:53 -07:00
recv-nt.c Make improvements 2023-10-08 08:59:53 -07:00
recv.c Make improvements 2023-10-08 08:59:53 -07:00
recvfrom-nt.c Make improvements 2023-10-08 08:59:53 -07:00
recvfrom.c Make improvements 2023-10-08 08:59:53 -07:00
recvmsg.c Make improvements 2023-10-08 08:59:53 -07:00
select-nt.c Make improvements 2023-10-08 08:59:53 -07:00
select.c Make improvements 2023-10-08 08:59:53 -07:00
select.h Make improvements 2023-09-06 12:34:59 -07:00
select.internal.h Make improvements 2023-09-21 07:30:39 -07:00
send-nt.c Make improvements 2023-10-08 08:59:53 -07:00
send.c Make improvements 2023-10-08 08:59:53 -07:00
sendfile.c Make improvements 2023-10-08 08:59:53 -07:00
sendfile.internal.h Remove _Hide keyword 2023-07-24 08:34:58 -07:00
sendmsg.c Make improvements 2023-10-08 08:59:53 -07:00
sendto-nt.c Make improvements 2023-10-08 08:59:53 -07:00
sendto.c Make improvements 2023-10-08 08:59:53 -07:00
setsockopt-nt.c Make improvements 2023-10-08 08:59:53 -07:00
setsockopt.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
shutdown-nt.c Make improvements 2023-10-08 08:59:53 -07:00
shutdown.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
sock.h Make improvements 2023-10-08 08:59:53 -07:00
sock.mk Clean up more code 2023-06-18 01:00:05 -07:00
sockaddr.c Fix some more socket bugs 2023-07-23 16:31:10 -07:00
sockaddr2bsd.c Fix some more socket bugs 2023-07-23 16:31:10 -07:00
sockaddr2linux.c Fix some more socket bugs 2023-07-23 16:31:10 -07:00
sockatmark.c Improve zip read-only filesystem 2023-08-16 17:52:12 -07:00
sockdebug.c Fix warnings 2023-09-01 20:50:18 -07:00
socket-nt.c Make improvements 2023-10-08 08:59:53 -07:00
socket-sysv.c Fix socket() EPROTONOSUPPORT fallback on MacOS 2023-08-22 14:34:37 -07:00
socket.c Make more fixes and improvements 2023-07-29 18:44:15 -07:00
socketpair-nt.c Make improvements 2023-10-08 08:59:53 -07:00
socketpair-sysv.c Perform fine-tuning of socketpair and pipe 2021-03-16 22:44:54 -07:00
socketpair.c Strengthen the pledge() polyfill 2022-06-27 13:02:17 -07:00
sys_sendfile_freebsd.S Reduce Makefile dependencies by 4% 2022-05-23 15:07:01 -07:00
sys_sendfile_xnu.S Reduce Makefile dependencies by 4% 2022-05-23 15:07:01 -07:00
syscall_fd.internal.h Make improvements 2023-10-08 08:59:53 -07:00
syslog.c Make improvements 2023-10-08 08:59:53 -07:00
syslog.h Add more missing libc functionality 2022-08-06 10:50:51 -07:00
winsockblock.c Make improvements 2023-10-08 08:59:53 -07:00
yoink.inc Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00