Skip to content

Commit

Permalink
Merge pull request #15 from dalance/fix_getrlimit
Browse files Browse the repository at this point in the history
Fix type of getrlimit arg
  • Loading branch information
alecmocatta committed Jul 21, 2019
2 parents aaf0ede + 0d4f8ab commit 85383ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/valgrind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ use std::mem;
#[cfg(unix)]
use try_from::TryInto;

#[cfg(any(target_os = "android", target_os = "linux"))]
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
fn getrlimit(resource: libc::__rlimit_resource_t) -> Result<libc::rlimit64, nix::Error> {
let mut rlim: libc::rlimit64 = unsafe { mem::uninitialized() };
let err = unsafe { libc::getrlimit64(resource, &mut rlim) };
errno::Errno::result(err).map(|_| rlim)
}
#[cfg(any(target_os = "android", target_env = "musl"))]
fn getrlimit(resource: libc::c_int) -> Result<libc::rlimit64, nix::Error> {
let mut rlim: libc::rlimit64 = unsafe { mem::uninitialized() };
let err = unsafe { libc::getrlimit64(resource, &mut rlim) };
Expand Down

0 comments on commit 85383ff

Please sign in to comment.