cosmopolitan/examples
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
..
package Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
pyapp Stop using .com extension in monorepo 2024-03-03 03:12:19 -08:00
pylife Stop using .com extension in monorepo 2024-03-03 03:12:19 -08:00
aba.c Harden against aba problem 2024-08-26 20:01:55 -07:00
blas.cc Remove bad defines from early days of project 2024-07-24 12:11:21 -07:00
BUILD.mk Release Cosmopolitan v3.8.0 2024-08-30 20:14:07 -07:00
clear.c Overhaul process spawning 2023-09-10 08:17:44 -07:00
crashreport.c Improve backtraces 2024-05-30 15:23:11 -07:00
crashreport2.cc Fix a bug in example code 2024-07-19 19:11:28 -07:00
ctrlc.c Fix some additional Windows TTY issues 2023-10-04 02:17:25 -07:00
date.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
dlopen.c Fix dlopen() for FreeBSD and NetBSD 2023-11-18 04:35:48 -08:00
env.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
greenbean.c Fix greenbean example 2024-07-07 17:52:33 -07:00
gui.c Make examples folder somewhat more focused 2021-03-05 06:09:12 -08:00
hangman.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
hello.c Remove printf() linking hack 2023-06-17 10:13:50 -07:00
hello2.c Introduce new linker for fat ape binaries 2023-08-11 04:39:19 -07:00
hellolua.c Fix warnings 2023-09-01 20:50:18 -07:00
hellolua.lua Add Hello World example for LUA C API (#97) 2021-03-08 14:15:59 -08:00
helloplus.cc Fix regression with last commit 2024-07-20 16:43:48 -07:00
hiredis.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
kilo.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
life.c Always initialize thread local storage 2022-07-19 00:21:46 -07:00
linenoise.c Clean up some code 2023-10-11 11:45:31 -07:00
localtime.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
ls.c Bring back gc() function 2024-01-08 10:26:28 -08:00
nc.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
nesemu1.cc Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
nproc.c Make malloc scalable on all platforms 2024-08-15 23:32:53 -07:00
parsefloat.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
pause.c Write more tests and improve kill() on Windows 2023-10-13 04:38:45 -07:00
picol.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
portscan.c Clean up some code 2023-11-16 17:31:07 -08:00
print-struct.c Cull the examples folder 2023-10-11 21:45:32 -07:00
printargs.c Make improvements 2022-04-24 10:06:05 -07:00
romanize.c Fix the build 2024-08-26 16:44:05 -07:00
rusage.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
script.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
script.txt Add script.com and whois.com courtesy of FreeBSD 2022-09-13 20:26:13 -07:00
seq.c Cull the examples folder 2023-10-11 21:45:32 -07:00
setcontext.c Implement swapcontext() and makecontext() 2023-07-02 09:01:44 -07:00
setitimer.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
spawn.c Fix bugs in poll(), select(), ppoll(), and pselect() 2024-09-02 00:29:52 -07:00
spawn_bench.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
stackexplorer.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
stat.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
statfs.c Mint APE Loader v1.7 2023-08-17 09:04:50 -07:00
stringbuffer.c Clean up some code 2023-11-16 17:31:07 -08:00
sysconf.c Clean up some code 2023-10-11 11:45:31 -07:00
sysinfo.c Clean up some code 2023-10-11 11:45:31 -07:00
system.c Make improvements 2024-02-12 10:23:00 -08:00
trapping.c Introduce support for trapping math 2024-04-30 13:38:43 -07:00
ttyinfo.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
ucontext-sigfpe-recovery.c Cull the examples folder 2023-10-11 21:45:32 -07:00
uname.c Apply clang-format update to repo (#1154) 2024-04-25 10:38:00 -07:00
vga.c Mint APE Loader v1.5 2023-07-26 13:54:49 -07:00
vga2.c [metal] Add a uprintf() routine, for non-emergency boot logging (#905) 2023-10-25 14:32:20 -07:00
walk.c Run clang-format (#1197) 2024-06-01 16:30:43 -04:00
wall.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
whois.c Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00