mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
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:
parent
ef6387ee5e
commit
9c0821def7
15 changed files with 280 additions and 58 deletions
|
@ -31,10 +31,10 @@ __msabi extern typeof(CreateThread) *const __imp_CreateThread;
|
|||
* @return thread handle, or 0 on failure
|
||||
* @note this wrapper takes care of ABI, STRACE()
|
||||
*/
|
||||
textwindows int64_t CreateThread(
|
||||
struct NtSecurityAttributes *lpThreadAttributes, size_t dwStackSize,
|
||||
NtThreadStartRoutine lpStartAddress, void *lpParameter,
|
||||
uint32_t dwCreationFlags, uint32_t *opt_lpThreadId) {
|
||||
textwindows int64_t
|
||||
CreateThread(struct NtSecurityAttributes *lpThreadAttributes,
|
||||
size_t dwStackSize, void *lpStartAddress, void *lpParameter,
|
||||
uint32_t dwCreationFlags, uint32_t *opt_lpThreadId) {
|
||||
int64_t hHandle;
|
||||
hHandle = __imp_CreateThread(lpThreadAttributes, dwStackSize, lpStartAddress,
|
||||
lpParameter, dwCreationFlags, opt_lpThreadId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue