@@ -262,7 +262,7 @@ pub(crate) fn strerror(code: u16) -> &'static str {
262
262
pub type Rights = u64 ;
263
263
/// The right to invoke `fd_datasync`.
264
264
/// If `path_open` is set, includes the right to invoke
265
- /// `path_open` with `fdflag ::dsync`.
265
+ /// `path_open` with `fdflags ::dsync`.
266
266
pub const RIGHTS_FD_DATASYNC : Rights = 0x1 ;
267
267
/// The right to invoke `fd_read` and `sock_recv`.
268
268
/// If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
@@ -273,10 +273,10 @@ pub const RIGHTS_FD_SEEK: Rights = 0x4;
273
273
pub const RIGHTS_FD_FDSTAT_SET_FLAGS : Rights = 0x8 ;
274
274
/// The right to invoke `fd_sync`.
275
275
/// If `path_open` is set, includes the right to invoke
276
- /// `path_open` with `fdflag ::rsync` and `fdflag ::dsync`.
276
+ /// `path_open` with `fdflags ::rsync` and `fdflags ::dsync`.
277
277
pub const RIGHTS_FD_SYNC : Rights = 0x10 ;
278
278
/// The right to invoke `fd_seek` in such a way that the file offset
279
- /// remains unaltered (i.e., `WHENCE_CUR ` with offset zero), or to
279
+ /// remains unaltered (i.e., `whence::cur ` with offset zero), or to
280
280
/// invoke `fd_tell`.
281
281
pub const RIGHTS_FD_TELL : Rights = 0x20 ;
282
282
/// The right to invoke `fd_write` and `sock_send`.
@@ -430,13 +430,13 @@ pub struct Fdstat {
430
430
}
431
431
pub type Device = u64 ;
432
432
pub type Fstflags = u16 ;
433
- /// Adjust the last data access timestamp to the value stored in `filestat::st_atim `.
433
+ /// Adjust the last data access timestamp to the value stored in `filestat::atim `.
434
434
pub const FSTFLAGS_ATIM : Fstflags = 0x1 ;
435
- /// Adjust the last data access timestamp to the time of clock `clock ::realtime`.
435
+ /// Adjust the last data access timestamp to the time of clock `clockid ::realtime`.
436
436
pub const FSTFLAGS_ATIM_NOW : Fstflags = 0x2 ;
437
- /// Adjust the last data modification timestamp to the value stored in `filestat::st_mtim `.
437
+ /// Adjust the last data modification timestamp to the value stored in `filestat::mtim `.
438
438
pub const FSTFLAGS_MTIM : Fstflags = 0x4 ;
439
- /// Adjust the last data modification timestamp to the time of clock `clock ::realtime`.
439
+ /// Adjust the last data modification timestamp to the time of clock `clockid ::realtime`.
440
440
pub const FSTFLAGS_MTIM_NOW : Fstflags = 0x8 ;
441
441
pub type Lookupflags = u32 ;
442
442
/// As long as the resolved path corresponds to a symbolic link, it is expanded.
@@ -473,13 +473,13 @@ pub struct Filestat {
473
473
}
474
474
pub type Userdata = u64 ;
475
475
pub type Eventtype = u8 ;
476
- /// The time value of clock `subscription::u.clock.clock_id ` has
477
- /// reached timestamp `subscription::u.clock. timeout`.
476
+ /// The time value of clock `subscription_clock::id ` has
477
+ /// reached timestamp `subscription_clock:: timeout`.
478
478
pub const EVENTTYPE_CLOCK : Eventtype = 0 ;
479
- /// File descriptor `subscription::u.fd_readwrite.fd ` has data
479
+ /// File descriptor `subscription_fd_readwrite::file_descriptor ` has data
480
480
/// available for reading. This event always triggers for regular files.
481
481
pub const EVENTTYPE_FD_READ : Eventtype = 1 ;
482
- /// File descriptor `subscription::u.fd_readwrite.fd ` has capacity
482
+ /// File descriptor `subscription_fd_readwrite::file_descriptor ` has capacity
483
483
/// available for writing. This event always triggers for regular files.
484
484
pub const EVENTTYPE_FD_WRITE : Eventtype = 2 ;
485
485
pub type Eventrwflags = u16 ;
@@ -513,10 +513,10 @@ pub struct Event {
513
513
}
514
514
pub type Subclockflags = u16 ;
515
515
/// If set, treat the timestamp provided in
516
- /// `subscription::u.clock. timeout` as an absolute timestamp of clock
517
- /// `subscription::u.clock.clock_id.` If clear, treat the timestamp
518
- /// provided in `subscription::u.clock. timeout` relative to the
519
- /// current time value of clock `subscription::u.clock.clock_id.`
516
+ /// `subscription_clock:: timeout` as an absolute timestamp of clock
517
+ /// `subscription_clock::id`. If clear, treat the timestamp
518
+ /// provided in `subscription_clock:: timeout` relative to the
519
+ /// current time value of clock `subscription_clock::id`.
520
520
pub const SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME : Subclockflags = 0x1 ;
521
521
#[ repr( C ) ]
522
522
#[ derive( Copy , Clone ) ]
@@ -689,7 +689,7 @@ pub struct Prestat {
689
689
pub u : PrestatU ,
690
690
}
691
691
/// Read command-line argument data.
692
- /// The size of the array should match that returned by `wasi_args_sizes_get() `
692
+ /// The size of the array should match that returned by `args_sizes_get `
693
693
pub unsafe fn args_get ( argv : * mut * mut u8 , argv_buf : * mut u8 ) -> Result < ( ) > {
694
694
let rc = wasi_snapshot_preview1:: args_get ( argv, argv_buf) ;
695
695
if let Some ( err) = Error :: from_raw_error ( rc) {
@@ -717,7 +717,7 @@ pub unsafe fn args_sizes_get() -> Result<(Size, Size)> {
717
717
}
718
718
719
719
/// Read environment variable data.
720
- /// The sizes of the buffers should match that returned by `environ.sizes_get() `.
720
+ /// The sizes of the buffers should match that returned by `environ_sizes_get `.
721
721
pub unsafe fn environ_get ( environ : * mut * mut u8 , environ_buf : * mut u8 ) -> Result < ( ) > {
722
722
let rc = wasi_snapshot_preview1:: environ_get ( environ, environ_buf) ;
723
723
if let Some ( err) = Error :: from_raw_error ( rc) {
@@ -746,7 +746,8 @@ pub unsafe fn environ_sizes_get() -> Result<(Size, Size)> {
746
746
}
747
747
748
748
/// Return the resolution of a clock.
749
- /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, return `WASI_EINVAL`
749
+ /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
750
+ /// return `errno::inval`.
750
751
/// Note: This is similar to `clock_getres` in POSIX.
751
752
///
752
753
/// ## Parameters
@@ -874,7 +875,7 @@ pub unsafe fn fd_fdstat_set_flags(fd: Fd, flags: Fdflags) -> Result<()> {
874
875
}
875
876
876
877
/// Adjust the rights associated with a file descriptor.
877
- /// This can only be used to remove rights, and returns `ENOTCAPABLE ` if called in a way that would attempt to add rights
878
+ /// This can only be used to remove rights, and returns `errno::notcapable ` if called in a way that would attempt to add rights
878
879
///
879
880
/// ## Parameters
880
881
///
@@ -1279,7 +1280,7 @@ pub unsafe fn path_link(
1279
1280
///
1280
1281
/// * `dirflags` - Flags determining the method of how the path is resolved.
1281
1282
/// * `path` - The relative path of the file or directory to open, relative to the
1282
- /// `dirfd ` directory.
1283
+ /// `path_open::fd ` directory.
1283
1284
/// * `oflags` - The method by which to open the file.
1284
1285
/// * `fs_rights_base` - The initial rights of the newly created file descriptor. The
1285
1286
/// implementation is allowed to return a file descriptor with fewer rights
@@ -1349,7 +1350,7 @@ pub unsafe fn path_readlink(fd: Fd, path: &str, buf: *mut u8, buf_len: Size) ->
1349
1350
}
1350
1351
1351
1352
/// Remove a directory.
1352
- /// Return `ENOTEMPTY ` if the directory is not empty.
1353
+ /// Return `errno::notempty ` if the directory is not empty.
1353
1354
/// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
1354
1355
///
1355
1356
/// ## Parameters
@@ -1411,7 +1412,7 @@ pub unsafe fn path_symlink(old_path: &str, fd: Fd, new_path: &str) -> Result<()>
1411
1412
}
1412
1413
1413
1414
/// Unlink a file.
1414
- /// Return `EISDIR ` if the path refers to a directory.
1415
+ /// Return `errno::isdir ` if the path refers to a directory.
1415
1416
/// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
1416
1417
///
1417
1418
/// ## Parameters
@@ -1586,17 +1587,18 @@ pub mod wasi_snapshot_preview1 {
1586
1587
#[ link( wasm_import_module = "wasi_snapshot_preview1" ) ]
1587
1588
extern "C" {
1588
1589
/// Read command-line argument data.
1589
- /// The size of the array should match that returned by `wasi_args_sizes_get() `
1590
+ /// The size of the array should match that returned by `args_sizes_get `
1590
1591
pub fn args_get ( argv : * mut * mut u8 , argv_buf : * mut u8 ) -> Errno ;
1591
1592
/// Return command-line argument data sizes.
1592
1593
pub fn args_sizes_get ( argc : * mut Size , argv_buf_size : * mut Size ) -> Errno ;
1593
1594
/// Read environment variable data.
1594
- /// The sizes of the buffers should match that returned by `environ.sizes_get() `.
1595
+ /// The sizes of the buffers should match that returned by `environ_sizes_get `.
1595
1596
pub fn environ_get ( environ : * mut * mut u8 , environ_buf : * mut u8 ) -> Errno ;
1596
1597
/// Return command-line argument data sizes.
1597
1598
pub fn environ_sizes_get ( argc : * mut Size , argv_buf_size : * mut Size ) -> Errno ;
1598
1599
/// Return the resolution of a clock.
1599
- /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, return `WASI_EINVAL`
1600
+ /// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
1601
+ /// return `errno::inval`.
1600
1602
/// Note: This is similar to `clock_getres` in POSIX.
1601
1603
pub fn clock_res_get ( id : Clockid , resolution : * mut Timestamp ) -> Errno ;
1602
1604
/// Return the time value of a clock.
@@ -1621,7 +1623,7 @@ pub mod wasi_snapshot_preview1 {
1621
1623
/// Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
1622
1624
pub fn fd_fdstat_set_flags ( fd : Fd , flags : Fdflags ) -> Errno ;
1623
1625
/// Adjust the rights associated with a file descriptor.
1624
- /// This can only be used to remove rights, and returns `ENOTCAPABLE ` if called in a way that would attempt to add rights
1626
+ /// This can only be used to remove rights, and returns `errno::notcapable ` if called in a way that would attempt to add rights
1625
1627
pub fn fd_fdstat_set_rights (
1626
1628
fd : Fd ,
1627
1629
fs_rights_base : Rights ,
@@ -1775,7 +1777,7 @@ pub mod wasi_snapshot_preview1 {
1775
1777
bufused : * mut Size ,
1776
1778
) -> Errno ;
1777
1779
/// Remove a directory.
1778
- /// Return `ENOTEMPTY ` if the directory is not empty.
1780
+ /// Return `errno::notempty ` if the directory is not empty.
1779
1781
/// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
1780
1782
pub fn path_remove_directory ( fd : Fd , path_ptr : * const u8 , path_len : usize ) -> Errno ;
1781
1783
/// Rename a file or directory.
@@ -1798,7 +1800,7 @@ pub mod wasi_snapshot_preview1 {
1798
1800
new_path_len : usize ,
1799
1801
) -> Errno ;
1800
1802
/// Unlink a file.
1801
- /// Return `EISDIR ` if the path refers to a directory.
1803
+ /// Return `errno::isdir ` if the path refers to a directory.
1802
1804
/// Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
1803
1805
pub fn path_unlink_file ( fd : Fd , path_ptr : * const u8 , path_len : usize ) -> Errno ;
1804
1806
/// Concurrently poll for the occurrence of a set of events.
0 commit comments