-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document atomicity of write
and pwrite
, and technical fix about POSIX
#257
Conversation
Is it technically possible to provide atomic writes with respect to non-WASI code, such as other processes? (Seems unlikely when a file is |
Thanks for pointing out. Reviewing the related chapter of POSIX, it refers only to threads. |
The related chapter in POSIX only provides these guarantees when the functions are operating on regular files or symbolic links. Unless we intend WASI to differ, we should preserve that aspect of the guarantee.
|
WebAssembly#257 (comment) The atomicity is guaranteed only for regular files or symbolic links (only symbolic links for a regular files, right?) Delete expressions indicating 'all or nothing' to reflect the actual behavior of POSIX's`write` etc.
Thanks! I missed the phrase "when they operate on regular files or symbolic links".
I agree. So I rewrote about what "atomicity" stands for. |
WebAssembly#257 (comment) The atomicity is guaranteed only for regular files or symbolic links (only symbolic links for a regular files, right?) Delete expressions indicating 'all or nothing' to reflect the actual behavior of POSIX's`write` etc.
WebAssembly#257 (comment) Delete the sentences related to 'all data' completely Don't refer to symlink
Related thread of ZULIP: https://bytecodealliance.zulipchat.com/#narrow/stream/219900-wasi/topic/Why.20is.20.60iovecs.60.20an.20array.20of.20strings.3F The thread refers atomicity of `read`, but I couldn't make a good expression for the atomicity of `read`. So I add document only in `write` and `pwrite`.
The related POSIX document refers only to threads. https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_07 So the atomicity is limited in the process
WebAssembly#257 (comment) The atomicity is guaranteed only for regular files or symbolic links (only symbolic links for a regular files, right?) Delete expressions indicating 'all or nothing' to reflect the actual behavior of POSIX's`write` etc.
WebAssembly#257 (comment) Delete the sentences related to 'all data' completely Don't refer to symlink
@MaxDesiatov Thank you for the review! |
This looks good to me, thanks for seeing this through! |
See the commit message of each commit for details.