Skip to content

Commit

Permalink
Add devstat items
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 28, 2021
1 parent ecbb68b commit f594d0a
Show file tree
Hide file tree
Showing 2 changed files with 380 additions and 1 deletion.
17 changes: 16 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,7 @@ fn test_freebsd(target: &str) {
"sys/vmmeter.h",
"sys/wait.h",
"libprocstat.h",
"devstat.h",
"syslog.h",
"termios.h",
"time.h",
Expand Down Expand Up @@ -1918,7 +1919,9 @@ fn test_freebsd(target: &str) {
}
// Field is named `type` in C but that is a Rust keyword,
// so these fields are translated to `type_` in the bindings.
"type_" if struct_ == "rtprio" || struct_ == "sockstat" => "type".to_string(),
"type_" if struct_ == "rtprio" => "type".to_string(),
"type_" if struct_ == "sockstat" => "type".to_string(),
"type_" if struct_ == "devstat_match_table" => "type".to_string(),
s => s.to_string(),
}
});
Expand Down Expand Up @@ -2142,6 +2145,9 @@ fn test_freebsd(target: &str) {
// obsolete version
"vmtotal" if Some(11) == freebsd_ver => true,

// A wrapper around "long double".
"LongDoubleWrap" => true,

_ => false,
}
});
Expand Down Expand Up @@ -2172,6 +2178,10 @@ fn test_freebsd(target: &str) {
// https://github.com/gnzlbg/ctest/issues/68
"lio_listio" => true,

// It returns a `long double`, but it's a nightmare to bind correctly in rust
// for the moment, so it's a best effort thing...
"devstat_compute_etime" => true,

_ => false,
}
});
Expand Down Expand Up @@ -2244,6 +2254,11 @@ fn test_freebsd(target: &str) {

// `__sem_base` is a private struct field
("semid_ds", "__sem_base") => true,

// `snap_time` is a `long double`, but it's a nightmare to bind correctly in rust
// for the moment, so it's a best effort thing...
("statinfo", "snap_time") => true,

_ => false,
}
});
Expand Down
Loading

0 comments on commit f594d0a

Please sign in to comment.