ueno labeled Issue #2076:
The documentation of
wasi_common::virtfs::FileContents::pwrite
says:/// Write contents from `buf` to this file starting at `offset`. `offset` plus the length of /// `buf` is guaranteed to not exceed `max_size`. Implementations must not indicate more bytes /// have been written than the size of `buf`. fn pwrite(&mut self, buf: &[u8], offset: types::Filesize) -> Result<usize>;
while POSIX says the
offset
is a file offset rather than the offset in buffer. AlthoughFileContents::pwrite
is currently only used byInMemoryFile
implementation, it would be consistent to treat theoffset
as a file offset.
ueno opened Issue #2076:
The documentation of
wasi_common::virtfs::FileContents::pwrite
says:/// Write contents from `buf` to this file starting at `offset`. `offset` plus the length of /// `buf` is guaranteed to not exceed `max_size`. Implementations must not indicate more bytes /// have been written than the size of `buf`. fn pwrite(&mut self, buf: &[u8], offset: types::Filesize) -> Result<usize>;
while POSIX says the
offset
is a file offset rather than the offset in buffer. AlthoughFileContents::pwrite
is currently only used byInMemoryFile
implementation, it would be consistent to treat theoffset
as a file offset.
ueno edited Issue #2076:
The documentation of
wasi_common::virtfs::FileContents::pwrite
says:/// Write contents from `buf` to this file starting at `offset`. `offset` plus the length of /// `buf` is guaranteed to not exceed `max_size`. Implementations must not indicate more bytes /// have been written than the size of `buf`. fn pwrite(&mut self, buf: &[u8], offset: types::Filesize) -> Result<usize>;
while in POSIX (and WASI
fd_pwrite
) theoffset
is a file offset rather than the offset in buffer. AlthoughFileContents::pwrite
is currently only used byInMemoryFile
implementation, it would be consistent to treat theoffset
as a file offset.
ueno commented on Issue #2076:
Sorry, this was my misunderstanding and the function actually writes at the file offset.
ueno closed Issue #2076:
The documentation of
wasi_common::virtfs::FileContents::pwrite
says:/// Write contents from `buf` to this file starting at `offset`. `offset` plus the length of /// `buf` is guaranteed to not exceed `max_size`. Implementations must not indicate more bytes /// have been written than the size of `buf`. fn pwrite(&mut self, buf: &[u8], offset: types::Filesize) -> Result<usize>;
while in POSIX (and WASI
fd_pwrite
) theoffset
is a file offset rather than the offset in buffer. AlthoughFileContents::pwrite
is currently only used byInMemoryFile
implementation, it would be consistent to treat theoffset
as a file offset.
Last updated: Nov 22 2024 at 16:03 UTC