Skip to content
Snippets Groups Projects
Verified Commit 46a330ec authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix compilation of sys/resource

parent 64dde154
No related branches found
No related tags found
No related merge requests found
Pipeline #6055 passed with warnings
......@@ -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;
......
#[no_mangle]
pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
Sys::getrlimit(resource, rlp)
}
//! 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!();
// }
#[no_mangle]
pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
// TODO
RLIM_INFINITY
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment