Skip to content
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

Adhere to POSIX for fd_pwrite w/ append flag #3390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yagehu
Copy link
Contributor

@yagehu yagehu commented May 7, 2024

This commit makes the fd_pwrite behave as specified by POSIX when the fd was opened with the append flag. Specifically, POSIX says that pwrite should write to the specified offset "regardless of whether O_APPEND is set".

fixes #3389

@yagehu yagehu requested a review from ibmibmibm as a code owner May 7, 2024 21:35
Copy link
Member

juntao commented May 7, 2024

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


@github-actions github-actions bot added c-Test An issue/PR to enhance the test suite c-WASI labels May 7, 2024
@yagehu yagehu force-pushed the yagehu/pwrite-append branch 2 times, most recently from bb6b85b to b92c918 Compare May 7, 2024 21:53
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.84%. Comparing base (2498ccb) to head (1b84b54).
Report is 295 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3390      +/-   ##
==========================================
- Coverage   80.85%   79.84%   -1.02%     
==========================================
  Files         159      253      +94     
  Lines       23035    34945   +11910     
  Branches     4734     6135    +1401     
==========================================
+ Hits        18626    27902    +9276     
- Misses       3129     5613    +2484     
- Partials     1280     1430     +150     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This commit makes the `fd_pwrite` behave as specified by POSIX when the
fd was opened with the `append` flag.  Specifically, [POSIX][1] says
that `pwrite` should write to the specified offset "regardless of
whether O_APPEND is set".

fixes WasmEdge#3389

[1]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/

Signed-off-by: Yage Hu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-Test An issue/PR to enhance the test suite c-WASI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

On Darwin, fd_pwrite should respect offset even with append flag
2 participants