cosmopolitan/libc/sock
Justine Tunney 2ec413b5a9
Fix bugs in poll(), select(), ppoll(), and pselect()
poll() and select() now delegate to ppoll() and pselect() for assurances
that both polyfill implementations are correct and well-tested. Poll now
polyfills XNU and BSD quirks re: the hanndling of POLLNVAL and the other
similar status flags. This change resolves a misunderstanding concerning
how select(exceptfds) is intended to map to POLPRI. We now use E2BIG for
bouncing requests that exceed the 64 handle limit on Windows. With pipes
and consoles on Windows our poll impl will now report POLLHUP correctly.

Issues with Windows path generation have been fixed. For example, it was
problematic on Windows to say: posix_spawn_file_actions_addchdir_np("/")
due to the need to un-UNC paths in some additional places. Calling fstat
on UNC style volume path handles will now work. posix_spawn now supports
simulating the opening of /dev/null and other special paths on Windows.

Cosmopolitan no longer defines epoll(). I think wepoll is a nice project
for using epoll() on Windows socket handles. However we need generalized
file descriptor support to make epoll() for Windows work well enough for
inclusion in a C library. It's also not worth having epoll() if we can't
get it to work on XNU and BSD OSes which provide different abstractions.
Even epoll() on Linux isn't that great of an abstraction since it's full
of footguns. Last time I tried to get it to be useful I had little luck.
Considering how long it took to get poll() and select() to be consistent
across platforms, we really have no business claiming to have epoll too.
While it'd be nice to have fully implemented, the only software that use
epoll() are event i/o libraries used by things like nodejs. Event i/o is
not the best paradigm for handling i/o; threads make so much more sense.
2024-09-02 00:29:52 -07:00
..
struct Avoid linker conflicts on DescribeFoo symbols 2024-08-24 18:10:22 -07:00
accept-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
accept.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
accept4-sysv.c Fix typo in accept4-sysv.c () 2024-07-19 05:46:29 -07:00
accept4.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
alg.h Reduce header complexity 2023-11-28 14:39:42 -08:00
basesocket.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
bind-nt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
bind-sysv.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
bind.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
BUILD.mk Update Musl Libc code 2024-07-30 22:51:29 -07:00
closesocket-nt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
connect-nt.c Fix getpeername() bug on Windows 2024-08-25 11:28:53 -07:00
connect-sysv.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
connect.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
fixupnewsockfd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
gethostips.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
getsockname.c Fix getpeername() bug on Windows 2024-08-25 11:28:53 -07:00
getsockopt-nt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getsockopt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
goodsocket.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
goodsocket.internal.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
ifaddrs.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ifaddrs.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
in.h Add libresolv from Musl Libc 2023-12-08 20:04:10 -08:00
in6addr_any.c Make improvements 2024-01-29 16:31:58 -08:00
in6addr_loopback.c Make improvements 2024-01-29 16:31:58 -08:00
inet_addr.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
inet_aton.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
inet_ntoa.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
inet_ntop.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
inet_pton.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
internal.h Fix bugs in poll(), select(), ppoll(), and pselect() 2024-09-02 00:29:52 -07:00
iovec2nt.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
ipclassify.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
kntwsadata.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
listen-nt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
listen.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
recv-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
recv.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
recvfrom-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
recvfrom.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
recvmsg.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
select.h Rerun clang-format on the repo () 2024-06-15 16:34:48 -04:00
select.internal.h Avoid linker conflicts on DescribeFoo symbols 2024-08-24 18:10:22 -07:00
send-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
send.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
sendfile.c Share file offset across execve() on Windows 2024-08-03 17:48:00 -07:00
sendfile.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
sendmsg.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
sendto-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
sendto.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
setsockopt-nt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
setsockopt.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
shutdown-nt.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
shutdown.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
sock.h Fix some static analysis issues 2024-07-27 09:16:54 -07:00
sockaddr.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
sockaddr2bsd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sockaddr2linux.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
sockatmark.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
sockdebug.c Avoid linker conflicts on DescribeFoo symbols 2024-08-24 18:10:22 -07:00
socket-nt.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
socket-sysv.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
socket.c Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
socketpair-nt.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
socketpair-sysv.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
socketpair.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
sys_sendfile_freebsd.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
sys_sendfile_xnu.S Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
syscall_fd.internal.h Get rid of .internal.h convention in LIBC_INTRIN 2024-07-19 19:38:00 -07:00
syslog.h Add dontthrow attribute to most libc functions 2024-01-09 01:26:03 -08:00
winsockblock.c Apply clang-format update to repo () 2024-04-25 10:38:00 -07:00
wsaid.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
wsaid.internal.h Reduce header complexity 2023-11-28 14:39:42 -08:00
yoink.inc Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00