-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
The method rustix::param::page_size()
returns 0
when using Alpine Linux. Consider this program:
const _SC_PAGESIZE: std::ffi::c_int = 30;
extern "C" {
fn sysconf(name: std::ffi::c_int) -> std::ffi::c_long;
}
fn page_size() -> usize {
unsafe { sysconf(_SC_PAGESIZE) as usize }
}
fn main() {
println!("rustix: {}", rustix::param::page_size());
println!("libc: {}", page_size());
}
And this Cargo.toml
:
[package]
name = "playground"
version = "0.1.0"
authors = ["Yorick Peterse"]
edition = "2021"
[dependencies]
rustix = { version = "^0.38", features = ["fs", "mm", "param", "process", "net", "std", "time"], default-features = false }
libc = "*"
When running this with cargo run
, the output is as follows:
rustix: 0
libc: 4096
This was tested inside an Alpine 3.18.4 container, running on a Fedora 39 host with Linux kernel version 6.5.11.
Metadata
Metadata
Assignees
Labels
No labels