@@ -1877,6 +1877,7 @@ fn test_freebsd(target: &str) {
1877
1877
"sys/vmmeter.h" ,
1878
1878
"sys/wait.h" ,
1879
1879
"libprocstat.h" ,
1880
+ "devstat.h" ,
1880
1881
"syslog.h" ,
1881
1882
"termios.h" ,
1882
1883
"time.h" ,
@@ -1890,8 +1891,19 @@ fn test_freebsd(target: &str) {
1890
1891
cfg. type_name ( move |ty, is_struct, is_union| {
1891
1892
match ty {
1892
1893
// Just pass all these through, no need for a "struct" prefix
1893
- "FILE" | "fd_set" | "Dl_info" | "DIR" | "Elf32_Phdr" | "Elf64_Phdr"
1894
- | "Elf32_Auxinfo" | "Elf64_Auxinfo" => ty. to_string ( ) ,
1894
+ "FILE"
1895
+ | "fd_set"
1896
+ | "Dl_info"
1897
+ | "DIR"
1898
+ | "Elf32_Phdr"
1899
+ | "Elf64_Phdr"
1900
+ | "Elf32_Auxinfo"
1901
+ | "Elf64_Auxinfo"
1902
+ | "devstat_select_mode"
1903
+ | "devstat_support_flags"
1904
+ | "devstat_type_flags"
1905
+ | "devstat_match_flags"
1906
+ | "devstat_priority" => ty. to_string ( ) ,
1895
1907
1896
1908
// FIXME: https://github.com/rust-lang/libc/issues/1273
1897
1909
"sighandler_t" => "sig_t" . to_string ( ) ,
@@ -1919,7 +1931,9 @@ fn test_freebsd(target: &str) {
1919
1931
}
1920
1932
// Field is named `type` in C but that is a Rust keyword,
1921
1933
// so these fields are translated to `type_` in the bindings.
1922
- "type_" if struct_ == "rtprio" || struct_ == "sockstat" => "type" . to_string ( ) ,
1934
+ "type_" if struct_ == "rtprio" => "type" . to_string ( ) ,
1935
+ "type_" if struct_ == "sockstat" => "type" . to_string ( ) ,
1936
+ "type_" if struct_ == "devstat_match_table" => "type" . to_string ( ) ,
1923
1937
s => s. to_string ( ) ,
1924
1938
}
1925
1939
} ) ;
@@ -2149,6 +2163,10 @@ fn test_freebsd(target: &str) {
2149
2163
// for now, it doesn't matter too much...
2150
2164
"kvm_t" => true ,
2151
2165
2166
+ // The C norm is a nightmare to follow for `long double`. Its sized is checked since
2167
+ // it's being used as a struct field type in any case.
2168
+ "c_longdouble" => true ,
2169
+
2152
2170
_ => false ,
2153
2171
}
2154
2172
} ) ;
@@ -2176,6 +2194,9 @@ fn test_freebsd(target: &str) {
2176
2194
// `ptrace_coredump` introduced in FreeBSD 14.
2177
2195
"ptrace_coredump" if Some ( 14 ) > freebsd_ver => true ,
2178
2196
2197
+ // A wrapper around "long double".
2198
+ "LongDoubleWrap" => true ,
2199
+
2179
2200
_ => false ,
2180
2201
}
2181
2202
} ) ;
@@ -2206,6 +2227,10 @@ fn test_freebsd(target: &str) {
2206
2227
// https://github.com/gnzlbg/ctest/issues/68
2207
2228
"lio_listio" => true ,
2208
2229
2230
+ // It returns a `long double`, but it's a nightmare to bind correctly in rust
2231
+ // for the moment, so it's a best effort thing...
2232
+ "devstat_compute_etime" => true ,
2233
+
2209
2234
_ => false ,
2210
2235
}
2211
2236
} ) ;
@@ -2261,6 +2286,9 @@ fn test_freebsd(target: &str) {
2261
2286
( "if_data" , "__ifi_lastchange" ) => true ,
2262
2287
( "ifreq" , "ifr_ifru" ) => true ,
2263
2288
2289
+ // anonymous struct
2290
+ ( "devstat" , "dev_links" ) => true ,
2291
+
2264
2292
// FIXME: structs too complicated to bind for now...
2265
2293
( "kinfo_proc" , "ki_paddr" ) => true ,
2266
2294
( "kinfo_proc" , "ki_addr" ) => true ,
@@ -2278,6 +2306,11 @@ fn test_freebsd(target: &str) {
2278
2306
2279
2307
// `__sem_base` is a private struct field
2280
2308
( "semid_ds" , "__sem_base" ) => true ,
2309
+
2310
+ // `snap_time` is a `long double`, but it's a nightmare to bind correctly in rust
2311
+ // for the moment, so it's a best effort thing...
2312
+ ( "statinfo" , "snap_time" ) => true ,
2313
+
2281
2314
_ => false ,
2282
2315
}
2283
2316
} ) ;
0 commit comments