diff --git a/src/resource.rs b/src/resource.rs index 99025d4..039f48d 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -1,6 +1,6 @@ //! Set and get program scheduling priority use errno::{Errno, errno, set_errno}; -use libc::{PRIO_PROCESS,PRIO_PGRP,PRIO_USER,setpriority,getpriority, id_t}; +use libc::{PRIO_PROCESS,PRIO_PGRP,PRIO_USER,setpriority,getpriority,id_t,c_int}; /// Which identifier type to use (`pid`, `gid`, or `uid`) #[allow(missing_docs)] @@ -27,7 +27,7 @@ pub fn set_priority(which: Which, who: i32, priority: i32) -> Result<(), ()> { Which::User => PRIO_USER, }; - match unsafe { setpriority(c_which as u32, who as id_t, priority) } { + match unsafe { setpriority(c_which as c_int, who as id_t, priority) } { 0 => Ok(()), _ => Err(()), } @@ -47,7 +47,7 @@ pub fn get_priority(which: Which, who: i32) -> Result { }; set_errno(Errno(0)); - let priority = unsafe { getpriority(c_which as u32, who as id_t) }; + let priority = unsafe { getpriority(c_which as c_int, who as id_t) }; match errno().0 { 0 => Ok(priority), _ => Err(()),