Repository navigation
Conversation
When buffering on a FILE is disabled we still send both iovecs, even though the first one is always empty. Clean things up by skipping the empty iovec instead. (cherry picked from commit fde29c0)
tombl
added a commit
to tombl/distro
that referenced
this pull request
Oct 25, 2026
The kernel moves to tombl/linux@365cc111 (ryan-fixes), which is wasm with tombl/linux#64 and #65: an empty ramfs file grows sparsely on wasm instead of contiguously, ramfs gains fallocate without an MMU, and the unused THREAD_SHIFT is dropped. It also brings in tombl/linux#58, the clone failure cleanup that wasm already has. The UAPI headers are unchanged. musl moves to tombl/musl@dbbe5cbb (ryan-fixes), which is master with tombl/musl#14, #12 and #13: stdio skips an empty buffer in writev, as upstream musl does, the pointer-sized limits get long's type, syscall numbers 451 to 471 are added, swapon and swapoff are provided, and pthread_getattr_np reports the main thread's stack.
tombl
added a commit
to tombl/distro
that referenced
this pull request
Oct 25, 2026
The kernel moves to tombl/linux@3902e778 (ryan-fixes), which is wasm at 89fefa07 with tombl/linux#64 and #65: an empty ramfs file grows sparsely on wasm instead of contiguously, ramfs gains fallocate without an MMU, and the unused THREAD_SHIFT is dropped. The UAPI headers are unchanged. musl moves to tombl/musl@38da5853 (ryan-fixes), which is master with tombl/musl#14, #12 and #13: stdio skips an empty buffer in writev, as upstream musl does, the pointer-sized limits get long's type, syscall numbers 451 to 471 and map_shadow_stack are added and counted, swapon and swapoff are provided, and pthread_getattr_np reports the main thread's stack.
tombl
added a commit
to tombl/distro
that referenced
this pull request
Oct 25, 2026
The kernel moves to tombl/linux@84c7c188 (ryan-fixes), which is wasm at d1911fdd with tombl/linux#64 and #65: an empty ramfs file grows sparsely on wasm instead of contiguously, ramfs gains fallocate without an MMU, and the unused THREAD_SHIFT is dropped. The UAPI headers are unchanged. musl moves to tombl/musl@38da5853 (ryan-fixes), which is master with tombl/musl#14, #12 and #13: stdio skips an empty buffer in writev, as upstream musl does, the pointer-sized limits get long's type, syscall numbers 451 to 471 and map_shadow_stack are added and counted, swapon and swapoff are provided, and pthread_getattr_np reports the main thread's stack.
tombl
added a commit
to tombl/distro
that referenced
this pull request
Oct 27, 2026
The kernel moves to tombl/linux@84c7c188 (ryan-fixes), which is wasm at d1911fdd with tombl/linux#64 and #65: an empty ramfs file grows sparsely on wasm instead of contiguously, ramfs gains fallocate without an MMU, and the unused THREAD_SHIFT is dropped. The UAPI headers are unchanged. musl moves to tombl/musl@38da5853 (ryan-fixes), which is master with tombl/musl#14, #12 and #13: stdio skips an empty buffer in writev, as upstream musl does, the pointer-sized limits get long's type, syscall numbers 451 to 471 and map_shadow_stack are added and counted, swapon and swapoff are provided, and pthread_getattr_np reports the main thread's stack.
tombl
added a commit
to tombl/distro
that referenced
this pull request
Oct 27, 2026
The kernel moves to tombl/linux@84c7c188 (ryan-fixes), which is wasm at d1911fdd with tombl/linux#64 and #65: an empty ramfs file grows sparsely on wasm instead of contiguously, ramfs gains fallocate without an MMU, and the unused THREAD_SHIFT is dropped. The UAPI headers are unchanged. musl moves to tombl/musl@38da5853 (ryan-fixes), which is master with tombl/musl#14, #12 and #13: stdio skips an empty buffer in writev, as upstream musl does, the pointer-sized limits get long's type, syscall numbers 451 to 471 and map_shadow_stack are added and counted, swapon and swapoff are provided, and pthread_getattr_np reports the main thread's stack.
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.
A cherry-pick (
-x) of upstream musl fde29c0 by Casey Connolly, which our fork's base (61399d4, 2024-09) predates.An unbuffered stream's buffer is always empty.
__stdio_write()still sent it as the first iovec, and files whose kernel handler is a plain.writeget a zero-length write first, becausedo_loop_readv_writev()calls the handler once per segment./proc/<pid>/oom_score_adjfails such a write withEINVAL, so writing it through an unbuffered stream failed. systemd'sOOMScoreAdjust=is one example. That kernel behaviour matches upstream Linux, so this replaces tombl/linux#63, which skipped empty segments in the VFS.Test (basic-init
stdio-unbuffered-proc, in distro#206): fopen/proc/self/oom_score_adj,setvbuf(_IONBF), fputs"100\n", then read it back. Before (main's pins):fputs /proc/self/oom_score_adj: Invalid argument. After: pass.Found through ryanrasti/linux@657d4881 by Ryan Rasti, which patched the kernel instead.