Skip to content

Commit 72f1fb6

Browse files
committed
Added getloadavg for Linux, the BSDs and Solaris.
Sadly Android's bionic lacks this functionality.
1 parent 19fd504 commit 72f1fb6

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/unix/bsd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ f! {
342342
pub fn WCOREDUMP(status: ::c_int) -> bool {
343343
(status & 0o200) != 0
344344
}
345-
346345
}
347346

348347
extern {
@@ -360,6 +359,7 @@ extern {
360359
result: *mut *mut passwd) -> ::c_int;
361360
pub fn getprogname() -> *const ::c_char;
362361
pub fn setprogname(name: *const ::c_char);
362+
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
363363
}
364364

365365
cfg_if! {

src/unix/notbsd/linux/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ extern {
612612
resource: ::c_int,
613613
new_limit: *const ::rlimit64,
614614
old_limit: *mut ::rlimit64) -> ::c_int;
615+
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
615616
}
616617

617618
cfg_if! {

src/unix/solaris/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,5 +903,6 @@ extern {
903903
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
904904
pub fn getprogname() -> *const ::c_char;
905905
pub fn setprogname(name: *const ::c_char);
906+
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
906907
}
907908

0 commit comments

Comments
 (0)