Fix compilation of sys/resource

This commit is contained in:
Jeremy Soller
2019-09-18 15:55:27 -06:00
parent 64dde1548c
commit 46a330ec9e
4 changed files with 26 additions and 40 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ pub mod sys_file;
pub mod sys_ioctl;
pub mod sys_mman;
pub mod sys_ptrace;
//pub mod sys_resource;
pub mod sys_resource;
pub mod sys_select;
pub mod sys_socket;
pub mod sys_stat;
-4
View File
@@ -1,4 +0,0 @@
#[no_mangle]
pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
Sys::getrlimit(resource, rlp)
}
+25 -30
View File
@@ -1,10 +1,10 @@
//! sys/resource.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysresource.h.html
use header::sys_time::timeval;
use platform;
use platform::types::*;
use platform::{Pal, Sys};
use crate::header::sys_time::timeval;
use crate::platform;
use crate::platform::types::*;
use crate::platform::{Pal, Sys};
// Exported in bits file
// const RUSAGE_SELF: c_int = 0;
@@ -33,16 +33,6 @@ pub const RLIMIT_NICE: u64 = 13;
pub const RLIMIT_RTPRIO: u64 = 14;
pub const RLIMIT_NLIMITS: u64 = 15;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "redox")]
mod redox;
#[cfg(target_os = "linux")]
pub use linux::*;
#[cfg(target_os = "redox")]
pub use redox::*;
type rlim_t = u64;
#[repr(C)]
@@ -72,22 +62,27 @@ pub struct rusage {
}
// #[no_mangle]
pub unsafe extern "C" fn getpriority(which: c_int, who: id_t) -> c_int {
unimplemented!();
}
// pub unsafe extern "C" fn getpriority(which: c_int, who: id_t) -> c_int {
// unimplemented!();
// }
//
// #[no_mangle]
pub unsafe extern "C" fn getrusage(who: c_int, r_usage: *mut rusage) -> c_int {
// Sys::getrusage(who, r_usage)
unimplemented!();
}
// pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
// Sys::getrlimit(resource, rlp)
// }
//
// #[no_mangle]
pub unsafe extern "C" fn setpriority(which: c_int, who: id_t, nice: c_int) -> c_int {
unimplemented!();
}
// pub unsafe extern "C" fn getrusage(who: c_int, r_usage: *mut rusage) -> c_int {
// // Sys::getrusage(who, r_usage)
// unimplemented!();
// }
//
// #[no_mangle]
pub unsafe extern "C" fn setrlimit(resource: c_int, rlp: *const rlimit) -> c_int {
unimplemented!();
}
// pub unsafe extern "C" fn setpriority(which: c_int, who: id_t, nice: c_int) -> c_int {
// unimplemented!();
// }
//
// #[no_mangle]
// pub unsafe extern "C" fn setrlimit(resource: c_int, rlp: *const rlimit) -> c_int {
// unimplemented!();
// }
-5
View File
@@ -1,5 +0,0 @@
#[no_mangle]
pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
// TODO
RLIM_INFINITY
}