@@ -152,13 +152,21 @@ where
152
152
let mut cpath = path. as_bytes ( ) . to_vec ( ) ;
153
153
cpath. push ( 0 ) ;
154
154
if bigint {
155
- #[ cfg( not( target_os = "macos" ) ) ]
155
+ #[ cfg( not( any(
156
+ target_os = "macos" ,
157
+ target_os = "freebsd" ,
158
+ target_os = "openbsd"
159
+ ) ) ) ]
156
160
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
157
161
let ( code, result) = unsafe {
158
162
let mut result: libc:: statfs64 = std:: mem:: zeroed ( ) ;
159
163
( libc:: statfs64 ( cpath. as_ptr ( ) as _ , & mut result) , result)
160
164
} ;
161
- #[ cfg( target_os = "macos" ) ]
165
+ #[ cfg( any(
166
+ target_os = "macos" ,
167
+ target_os = "freebsd" ,
168
+ target_os = "openbsd"
169
+ ) ) ]
162
170
// SAFETY: `cpath` is NUL-terminated and result is pointer to valid statfs memory.
163
171
let ( code, result) = unsafe {
164
172
let mut result: libc:: statfs = std:: mem:: zeroed ( ) ;
@@ -168,7 +176,10 @@ where
168
176
return Err ( std:: io:: Error :: last_os_error ( ) . into ( ) ) ;
169
177
}
170
178
Ok ( StatFs {
179
+ #[ cfg( not( target_os = "openbsd" ) ) ]
171
180
typ : result. f_type as _ ,
181
+ #[ cfg( target_os = "openbsd" ) ]
182
+ typ : 0 as _ ,
172
183
bsize : result. f_bsize as _ ,
173
184
blocks : result. f_blocks as _ ,
174
185
bfree : result. f_bfree as _ ,
@@ -186,7 +197,10 @@ where
186
197
return Err ( std:: io:: Error :: last_os_error ( ) . into ( ) ) ;
187
198
}
188
199
Ok ( StatFs {
200
+ #[ cfg( not( target_os = "openbsd" ) ) ]
189
201
typ : result. f_type as _ ,
202
+ #[ cfg( target_os = "openbsd" ) ]
203
+ typ : 0 as _ ,
190
204
bsize : result. f_bsize as _ ,
191
205
blocks : result. f_blocks as _ ,
192
206
bfree : result. f_bfree as _ ,
0 commit comments