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

Commit 7ec7715

Browse files
committed
Swap info and fd-info
See the last commit in WebAssembly/wasi-filesystem#66 for details.
1 parent 37ac3ad commit 7ec7715

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

host/src/filesystem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx {
3030
todo!()
3131
}
3232

33-
fn fd_info(
33+
fn info(
3434
&mut self,
3535
fd: wasi_filesystem::Descriptor,
36-
) -> HostResult<wasi_filesystem::Info, wasi_filesystem::Errno> {
36+
) -> HostResult<wasi_filesystem::FdInfo, wasi_filesystem::Errno> {
3737
todo!()
3838
}
3939

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub unsafe extern "C" fn fd_datasync(fd: Fd) -> Errno {
248248
pub unsafe extern "C" fn fd_fdstat_get(fd: Fd, stat: *mut Fdstat) -> Errno {
249249
match Descriptor::get(fd) {
250250
Descriptor::File(file) => {
251-
let info = match wasi_filesystem::fd_info(file.fd) {
251+
let info = match wasi_filesystem::info(file.fd) {
252252
Ok(info) => info,
253253
Err(err) => return errno_from_wasi_filesystem(err),
254254
};

wit/wasi-filesystem.wit.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ type filedelta = s64
4646
type timestamp = u64
4747
```
4848

49-
## `info`
49+
## `fd-info`
5050
```wit
5151
/// Information associated with a descriptor.
5252
///
5353
/// Note: This was called `fdstat` in earlier versions of WASI.
54-
record info {
54+
record fd-info {
5555
/// The type of filesystem object referenced by a descriptor.
5656
%type: %type,
5757
/// Flags associated with a descriptor.
@@ -445,18 +445,18 @@ datasync: func(
445445
) -> result<_, errno>
446446
```
447447

448-
## `fd-info`
448+
## `info`
449449
```wit
450450
/// Get information associated with a descriptor.
451451
///
452452
/// Note: This returns similar flags to `fcntl(fd, F_GETFL)` in POSIX, as well
453453
/// as additional fields.
454454
///
455455
/// Note: This was called `fdstat_get` in earlier versions of WASI.
456-
fd-info: func(
456+
info: func(
457457
/// The resource to operate on.
458458
fd: descriptor,
459-
) -> result<info, errno>
459+
) -> result<fd-info, errno>
460460
```
461461

462462
## `set-size`

0 commit comments

Comments
 (0)