@@ -332,7 +332,7 @@ pub extern "C" fn getlogin_r(name: *mut c_char, namesize: size_t) -> c_int {
#[no_mangle]
pub extern "C" fn getpagesize() -> c_int {
- Sys::getpagesize()
+ sysconf(_SC_PAGESIZE) as c_int
}
// #[no_mangle]
@@ -13,6 +13,7 @@ pub const _SC_TZNAME_MAX: c_int = 6;
// ...
pub const _SC_VERSION: c_int = 29;
pub const _SC_PAGESIZE: c_int = 30;
+pub const _SC_PAGE_SIZE: c_int = 30;
pub const _SC_RE_DUP_MAX: c_int = 44;
@@ -237,11 +237,6 @@ impl Pal for Sys {
e(unsafe { syscall!(GETGID) }) as gid_t
- fn getpagesize() -> c_int {
- //TODO
- 4096
- }
-
fn getpgid(pid: pid_t) -> pid_t {
e(unsafe { syscall!(GETPGID, pid) }) as pid_t
@@ -75,8 +75,6 @@ pub trait Pal {
fn getgid() -> gid_t;
- fn getpagesize() -> c_int;
fn getpgid(pid: pid_t) -> pid_t;
fn getpid() -> pid_t;
@@ -534,10 +534,6 @@ impl Pal for Sys {
e(syscall::getgid()) as gid_t
e(syscall::getpgid(pid as usize)) as pid_t