Repository navigation
lib: windows: _read: Call NtReadFile, rather than read - #4
Merged
Merged
Conversation
lib/windows/_read.c answered with read, which kaem.windows.run builds from lib/windows/read.c, the bare NtReadFile, beside the stub __buffered_read. configure-lib.sh's lists build read from lib/posix/buffered-read.c instead, whose __buffered_read fills its buffer with _read, so read, __buffered_read and _read called one another until the stack ran out. Mes compiled by MesCC died with STATUS_STACK_OVERFLOW once it had opened boot-5.scm, having printed nothing. _read is now the bare NtReadFile, as lib/linux/_read.c is the bare SYS_read, and read.c, which only the build without the buffer uses, calls it. * lib/windows/_read.c (_read): Call NtReadFile, moved here from read.c. * lib/windows/read.c (read): Call _read. * kaem.windows.run: Build lib/windows/_read.c ahead of read.c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/windows/_read.canswered withread.kaem.windows.runbuildsreadfromlib/windows/read.c, the bareNtReadFile, beside the stub__buffered_read, so mes-m2 never looped.configure-lib.sh's lists buildreadfromlib/posix/buffered-read.cinstead, whose__buffered_readfills its buffer with_read(lib/mes/__buffered_read.c:97), soread,__buffered_readand_readcalled one another until the stack ran out. Mes compiled by MesCC died with STATUS_STACK_OVERFLOW once it had openedboot-5.scm, having printed nothing; with its whole stack committed it ran off the end with an access violation instead._readis now the bareNtReadFile, aslib/linux/_read.cis the bareSYS_read, andread.c, which only the build without the buffer uses, calls it.kaem.windows.runbuilds_read.cahead ofread.c.The Windows CI builds and boots mes-m2 from the changed
kaem.windows.run; the MesCC-built libc this fixes runs in nova-nix's Mes job.