Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Swap info and fd-info
Browse files Browse the repository at this point in the history
See the last commit in WebAssembly/wasi-filesystem#66 for details.
  • Loading branch information
sunfishcode committed Nov 23, 2022
1 parent 37ac3ad commit cb616e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit cb616e8

Please sign in to comment.