summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2021-12-27 02:54:50 -0600
committerAlejandro Soto <alejandro@34project.org>2021-12-28 19:43:45 -0600
commit80fc84344e612a979d1eb048b2c02c41417b36be (patch)
tree28153325b70220b77d8ca91aa41de96d00426a81 /src/util.rs
parenta3212a0ba07da7bdae9e17637fbc237e2ae01c08 (diff)
Implement init hook
Diffstat (limited to '')
-rw-r--r--src/util.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs
index 2ad8c00..c21442f 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -3,7 +3,7 @@ use std::{
os::unix::io::{IntoRawFd, RawFd},
};
-use nix::unistd::close;
+use nix::unistd::{close, sysconf, SysconfVar};
use quick_error::quick_error;
quick_error! {
@@ -98,3 +98,7 @@ pub fn display_or<'a, T: fmt::Display + 'a>(
Params(maybe, default)
}
+
+pub fn page_size() -> usize {
+ sysconf(SysconfVar::PAGE_SIZE).unwrap().unwrap() as usize
+}