Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions host/src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx {
todo!()
}

fn fd_info(
fn info(
&mut self,
fd: wasi_filesystem::Descriptor,
) -> HostResult<wasi_filesystem::Info, wasi_filesystem::Errno> {
) -> HostResult<wasi_filesystem::FdInfo, wasi_filesystem::Errno> {
todo!()
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub unsafe extern "C" fn fd_datasync(fd: Fd) -> Errno {
pub unsafe extern "C" fn fd_fdstat_get(fd: Fd, stat: *mut Fdstat) -> Errno {
match Descriptor::get(fd) {
Descriptor::File(file) => {
let info = match wasi_filesystem::fd_info(file.fd) {
let info = match wasi_filesystem::info(file.fd) {
Ok(info) => info,
Err(err) => return errno_from_wasi_filesystem(err),
};
Expand Down
10 changes: 5 additions & 5 deletions wit/wasi-filesystem.wit.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ type filedelta = s64
type timestamp = u64
```

## `info`
## `fd-info`
```wit
/// Information associated with a descriptor.
///
/// Note: This was called `fdstat` in earlier versions of WASI.
record info {
record fd-info {
/// The type of filesystem object referenced by a descriptor.
%type: %type,
/// Flags associated with a descriptor.
Expand Down Expand Up @@ -445,18 +445,18 @@ datasync: func(
) -> result<_, errno>
```

## `fd-info`
## `info`
```wit
/// Get information associated with a descriptor.
///
/// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX, as well
/// as additional fields.
///
/// Note: This was called `fdstat_get` in earlier versions of WASI.
fd-info: func(
info: func(
/// The resource to operate on.
fd: descriptor,
) -> result<info, errno>
) -> result<fd-info, errno>
```

## `set-size`
Expand Down