Skip to content

Commit

Permalink
Use '*const libc::c_char' instead of '*const i8' for lstat argument (#18
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Roman Zeyde authored and gmjosack committed Aug 29, 2018
1 parent 10e8b07 commit 796409c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/page/hugepage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ fn priv_hugepage_supported(exp: usize) -> bool {
// If that fails (possibly because we're on an old kernel version), try the legacy method of
// parsing /proc/meminfo (described in more detail in legacy_hugepage_supported below).

use self::libc::{stat, lstat, ENOENT, ENOMEM};
use self::libc::{stat, lstat, ENOENT, ENOMEM, c_char};
use self::errno::errno;
use core::mem::uninitialized;

let path = get_linux_hugepage_directory!(exp);

let mut s = unsafe { uninitialized::<stat>() };
if unsafe { lstat(path.as_ptr() as *const i8, &mut s) } < 0 {
if unsafe { lstat(path.as_ptr() as *const c_char, &mut s) } < 0 {
// No other error should be possible here (see man 2 lstat)
let e = errno().0;
assert!(e == ENOENT || e == ENOMEM);
Expand Down

0 comments on commit 796409c

Please sign in to comment.