Skip to content

Commit

Permalink
fix seek when is in append mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed May 14, 2024
1 parent d65b674 commit d2e72c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/wasix/src/syscalls/wasi/fd_seek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ pub(crate) fn fd_seek_internal(
if !fd_entry.rights.contains(Rights::FD_SEEK) {
return Ok(Err(Errno::Access));
}
if fd_entry.flags.contains(Fdflags::APPEND) {
return Ok(Ok(fd_entry.offset.load(Ordering::Acquire)));
}

// TODO: handle case if fd is a dir?
let new_offset = match whence {
Expand Down

0 comments on commit d2e72c0

Please sign in to comment.