Make stdin pollable on Windows

You can now play Super Mario Bros in CMD.EXE using Cosmopolitan! This is
thanks to a new worker thread that's spawned on Windows whenever any one
of poll(), select(), or ioctl(FIONREAD) is linked.
This commit is contained in:
Justine Tunney 2023-08-13 22:42:25 -07:00
parent ef6387ee5e
commit 9c0821def7
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15 changed files with 280 additions and 58 deletions

View file

@ -54,7 +54,7 @@ textwindows int sys_socketpair_nt(int family, int type, int proto, int sv[2]) {
return eopnotsupp();
}
CreatePipeName(pipename);
__create_pipe_name(pipename);
__fds_lock();
reader = __reservefd_unlocked(-1);
writer = __reservefd_unlocked(-1);