Auto merge of #284 - lemonrock:getloadavg, r=alexcrichton

Added getloadavg for Linux, the BSDs and Solaris.

Sadly Android's bionic lacks this functionality.
This commit is contained in:
bors 2016-05-11 15:16:56 -07:00
commit 6598e2cbfd
3 changed files with 3 additions and 1 deletions

View file

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

View file

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

View file

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