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:
commit
6598e2cbfd
|
@ -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! {
|
||||||
|
|
|
@ -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! {
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue