@@ -712,7 +712,7 @@ macro_rules! ioctl_read_buf {
712
712
pub unsafe fn $name( fd: $crate:: libc:: c_int,
713
713
data: & mut [ $ty] )
714
714
-> $crate:: Result <$crate:: libc:: c_int> {
715
- convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_read!( $ioty, $nr, data . len ( ) * :: std:: mem:: size_of :: <$ty> ( ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
715
+ convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_read!( $ioty, $nr, :: std:: mem:: size_of_val ( data ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
716
716
}
717
717
)
718
718
}
@@ -751,7 +751,7 @@ macro_rules! ioctl_write_buf {
751
751
pub unsafe fn $name( fd: $crate:: libc:: c_int,
752
752
data: & [ $ty] )
753
753
-> $crate:: Result <$crate:: libc:: c_int> {
754
- convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_write!( $ioty, $nr, data . len ( ) * :: std:: mem:: size_of :: <$ty> ( ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
754
+ convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_write!( $ioty, $nr, :: std:: mem:: size_of_val ( data ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
755
755
}
756
756
)
757
757
}
@@ -780,7 +780,7 @@ macro_rules! ioctl_readwrite_buf {
780
780
pub unsafe fn $name( fd: $crate:: libc:: c_int,
781
781
data: & mut [ $ty] )
782
782
-> $crate:: Result <$crate:: libc:: c_int> {
783
- convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_readwrite!( $ioty, $nr, data . len ( ) * :: std:: mem:: size_of :: <$ty> ( ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
783
+ convert_ioctl_res!( $crate:: libc:: ioctl( fd, request_code_readwrite!( $ioty, $nr, :: std:: mem:: size_of_val ( data ) ) as $crate:: sys:: ioctl:: ioctl_num_type, data) )
784
784
}
785
785
)
786
786
}
0 commit comments