Added getloadavg for Linux, the BSDs and Solaris.

Sadly Android's bionic lacks this functionality.
This commit is contained in:
Raphael Cohn 2016-05-11 18:06:14 +01:00
parent 19fd504725
commit 72f1fb68d8
3 changed files with 3 additions and 1 deletions

View File

@ -342,7 +342,6 @@ f! {
pub fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0o200) != 0
}
}
extern {
@ -360,6 +359,7 @@ extern {
result: *mut *mut passwd) -> ::c_int;
pub fn getprogname() -> *const ::c_char;
pub fn setprogname(name: *const ::c_char);
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
}
cfg_if! {

View File

@ -612,6 +612,7 @@ extern {
resource: ::c_int,
new_limit: *const ::rlimit64,
old_limit: *mut ::rlimit64) -> ::c_int;
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
}
cfg_if! {

View File

@ -903,5 +903,6 @@ extern {
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn getprogname() -> *const ::c_char;
pub fn setprogname(name: *const ::c_char);
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
}