Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an Emscripten-specific implementation for fdatasync using WASI's __wasi_fd_sync. The reviewer correctly pointed out a bug where a negative error code is passed to __wasi_syscall_ret, which expects a positive error code. This would result in errno being set to a negative value, violating POSIX standards. A code suggestion was provided to remove the minus sign.
Call __wasi_fd_sync directly, like fsync already does, instead of going through __syscall_fdatasync.
aaalloc
force-pushed
the
fix_lto_fsync_fdatasync
branch
from
November 7, 2026 00:23
f9ce617 to
6b99fb6
Compare
Collaborator
|
I feel like this error not correct and there is probably a fix on the llvm side that fixes the root cause here.. I'm looking into it now. |
Collaborator
|
I have a fix on the llvm side: llvm/llvm-project#239883 I'm still not if this is quite the right place to fix the issue.. |
This branch has not been deployed
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.
From #27939
while compiling
You get
and thats because of this
It seems that
fdatasyncis practically the same as
fsyncbut here we don't have SYS_fsync definition in
system/lib/libc/musl/arch/emscripten/bits/syscall.h, so i assume it never goes into the else, and there you go you have your double definitionI followed how fsync is defined but maybe we can go the other way around by applying how fdatasync was to fsync, i don't know.
I have runned test with
and everything pass