@@ -332,15 +332,15 @@ pub const RIGHTS_POLL_FD_READWRITE: Rights = 0x8000000;
332
332
pub const RIGHTS_SOCK_SHUTDOWN : Rights = 0x10000000 ;
333
333
pub type Fd = u32 ;
334
334
#[ repr( C ) ]
335
- #[ derive( Copy , Clone ) ]
335
+ #[ derive( Copy , Clone , Debug ) ]
336
336
pub struct Iovec {
337
337
/// The address of the buffer to be filled.
338
338
pub buf : * mut u8 ,
339
339
/// The length of the buffer to be filled.
340
340
pub buf_len : Size ,
341
341
}
342
342
#[ repr( C ) ]
343
- #[ derive( Copy , Clone ) ]
343
+ #[ derive( Copy , Clone , Debug ) ]
344
344
pub struct Ciovec {
345
345
/// The address of the buffer to be written.
346
346
pub buf : * const u8 ,
@@ -378,7 +378,7 @@ pub const FILETYPE_SOCKET_STREAM: Filetype = 6;
378
378
/// The file refers to a symbolic link inode.
379
379
pub const FILETYPE_SYMBOLIC_LINK : Filetype = 7 ;
380
380
#[ repr( C ) ]
381
- #[ derive( Copy , Clone ) ]
381
+ #[ derive( Copy , Clone , Debug ) ]
382
382
pub struct Dirent {
383
383
/// The offset of the next directory entry stored in this directory.
384
384
pub d_next : Dircookie ,
@@ -416,7 +416,7 @@ pub const FDFLAGS_RSYNC: Fdflags = 0x8;
416
416
/// may also synchronously update the file's metadata.
417
417
pub const FDFLAGS_SYNC : Fdflags = 0x10 ;
418
418
#[ repr( C ) ]
419
- #[ derive( Copy , Clone ) ]
419
+ #[ derive( Copy , Clone , Debug ) ]
420
420
pub struct Fdstat {
421
421
/// File type.
422
422
pub fs_filetype : Filetype ,
@@ -452,7 +452,7 @@ pub const OFLAGS_EXCL: Oflags = 0x4;
452
452
pub const OFLAGS_TRUNC : Oflags = 0x8 ;
453
453
pub type Linkcount = u64 ;
454
454
#[ repr( C ) ]
455
- #[ derive( Copy , Clone ) ]
455
+ #[ derive( Copy , Clone , Debug ) ]
456
456
pub struct Filestat {
457
457
/// Device ID of device containing the file.
458
458
pub dev : Device ,
@@ -486,15 +486,15 @@ pub type Eventrwflags = u16;
486
486
/// The peer of this socket has closed or disconnected.
487
487
pub const EVENTRWFLAGS_FD_READWRITE_HANGUP : Eventrwflags = 0x1 ;
488
488
#[ repr( C ) ]
489
- #[ derive( Copy , Clone ) ]
489
+ #[ derive( Copy , Clone , Debug ) ]
490
490
pub struct EventFdReadwrite {
491
491
/// The number of bytes available for reading or writing.
492
492
pub nbytes : Filesize ,
493
493
/// The state of the file descriptor.
494
494
pub flags : Eventrwflags ,
495
495
}
496
496
#[ repr( C ) ]
497
- #[ derive( Copy , Clone ) ]
497
+ #[ derive( Copy , Clone , Debug ) ]
498
498
pub struct Event {
499
499
/// User-provided value that got attached to `subscription::userdata`.
500
500
pub userdata : Userdata ,
@@ -514,7 +514,7 @@ pub type Subclockflags = u16;
514
514
/// current time value of clock `subscription_clock::id`.
515
515
pub const SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME : Subclockflags = 0x1 ;
516
516
#[ repr( C ) ]
517
- #[ derive( Copy , Clone ) ]
517
+ #[ derive( Copy , Clone , Debug ) ]
518
518
pub struct SubscriptionClock {
519
519
/// The clock against which to compare the timestamp.
520
520
pub id : Clockid ,
@@ -527,7 +527,7 @@ pub struct SubscriptionClock {
527
527
pub flags : Subclockflags ,
528
528
}
529
529
#[ repr( C ) ]
530
- #[ derive( Copy , Clone ) ]
530
+ #[ derive( Copy , Clone , Debug ) ]
531
531
pub struct SubscriptionFdReadwrite {
532
532
/// The file descriptor on which to wait for it to become ready for reading or writing.
533
533
pub file_descriptor : Fd ,
@@ -668,7 +668,7 @@ pub type Preopentype = u8;
668
668
/// A pre-opened directory.
669
669
pub const PREOPENTYPE_DIR : Preopentype = 0 ;
670
670
#[ repr( C ) ]
671
- #[ derive( Copy , Clone ) ]
671
+ #[ derive( Copy , Clone , Debug ) ]
672
672
pub struct PrestatDir {
673
673
/// The length of the directory name for use with `fd_prestat_dir_name`.
674
674
pub pr_name_len : Size ,
@@ -724,21 +724,23 @@ pub unsafe fn environ_get(environ: *mut *mut u8, environ_buf: *mut u8) -> Result
724
724
}
725
725
}
726
726
727
- /// Return command-line argument data sizes.
727
+ /// Return environment variable data sizes.
728
728
///
729
729
/// ## Return
730
730
///
731
- /// * `argc ` - The number of arguments.
732
- /// * `argv_buf_size ` - The size of the argument string data.
731
+ /// * `environc ` - The number of environment variable arguments.
732
+ /// * `environ_buf_size ` - The size of the environment variable data.
733
733
pub unsafe fn environ_sizes_get ( ) -> Result < ( Size , Size ) > {
734
- let mut argc = MaybeUninit :: uninit ( ) ;
735
- let mut argv_buf_size = MaybeUninit :: uninit ( ) ;
736
- let rc =
737
- wasi_snapshot_preview1:: environ_sizes_get ( argc. as_mut_ptr ( ) , argv_buf_size. as_mut_ptr ( ) ) ;
734
+ let mut environc = MaybeUninit :: uninit ( ) ;
735
+ let mut environ_buf_size = MaybeUninit :: uninit ( ) ;
736
+ let rc = wasi_snapshot_preview1:: environ_sizes_get (
737
+ environc. as_mut_ptr ( ) ,
738
+ environ_buf_size. as_mut_ptr ( ) ,
739
+ ) ;
738
740
if let Some ( err) = Error :: from_raw_error ( rc) {
739
741
Err ( err)
740
742
} else {
741
- Ok ( ( argc . assume_init ( ) , argv_buf_size . assume_init ( ) ) )
743
+ Ok ( ( environc . assume_init ( ) , environ_buf_size . assume_init ( ) ) )
742
744
}
743
745
}
744
746
@@ -1591,8 +1593,8 @@ pub mod wasi_snapshot_preview1 {
1591
1593
/// Read environment variable data.
1592
1594
/// The sizes of the buffers should match that returned by `environ_sizes_get`.
1593
1595
pub fn environ_get ( environ : * mut * mut u8 , environ_buf : * mut u8 ) -> Errno ;
1594
- /// Return command-line argument data sizes.
1595
- pub fn environ_sizes_get ( argc : * mut Size , argv_buf_size : * mut Size ) -> Errno ;
1596
+ /// Return environment variable data sizes.
1597
+ pub fn environ_sizes_get ( environc : * mut Size , environ_buf_size : * mut Size ) -> Errno ;
1596
1598
/// Return the resolution of a clock.
1597
1599
/// Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
1598
1600
/// return `errno::inval`.
0 commit comments