@@ -46,25 +46,13 @@ impl FileDesc {
46
46
fd
47
47
}
48
48
49
- #[ cfg( target_os = "freertos" ) ]
50
- pub fn read ( & self , _buf : & mut [ u8 ] ) -> io:: Result < usize > {
51
- crate :: sys:: unsupported ( )
52
- }
53
-
54
- #[ cfg( not( target_os = "freertos" ) ) ]
55
49
pub fn read ( & self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
56
50
let ret = cvt ( unsafe {
57
51
libc:: read ( self . fd , buf. as_mut_ptr ( ) as * mut c_void , cmp:: min ( buf. len ( ) , max_len ( ) ) )
58
52
} ) ?;
59
53
Ok ( ret as usize )
60
54
}
61
55
62
- #[ cfg( target_os = "freertos" ) ]
63
- pub fn read_vectored ( & self , _bufs : & mut [ IoSliceMut < ' _ > ] ) -> io:: Result < usize > {
64
- crate :: sys:: unsupported ( )
65
- }
66
-
67
- #[ cfg( not( target_os = "freertos" ) ) ]
68
56
pub fn read_vectored ( & self , bufs : & mut [ IoSliceMut < ' _ > ] ) -> io:: Result < usize > {
69
57
let ret = cvt ( unsafe {
70
58
libc:: readv (
@@ -115,25 +103,13 @@ impl FileDesc {
115
103
}
116
104
}
117
105
118
- #[ cfg( target_os = "freertos" ) ]
119
- pub fn write ( & self , _buf : & [ u8 ] ) -> io:: Result < usize > {
120
- crate :: sys:: unsupported ( )
121
- }
122
-
123
- #[ cfg( not( target_os = "freertos" ) ) ]
124
106
pub fn write ( & self , buf : & [ u8 ] ) -> io:: Result < usize > {
125
107
let ret = cvt ( unsafe {
126
108
libc:: write ( self . fd , buf. as_ptr ( ) as * const c_void , cmp:: min ( buf. len ( ) , max_len ( ) ) )
127
109
} ) ?;
128
110
Ok ( ret as usize )
129
111
}
130
112
131
- #[ cfg( target_os = "freertos" ) ]
132
- pub fn write_vectored ( & self , _bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
133
- crate :: sys:: unsupported ( )
134
- }
135
-
136
- #[ cfg( not( target_os = "freertos" ) ) ]
137
113
pub fn write_vectored ( & self , bufs : & [ IoSlice < ' _ > ] ) -> io:: Result < usize > {
138
114
let ret = cvt ( unsafe {
139
115
libc:: writev (
0 commit comments