@@ -23,6 +23,7 @@ global:
l_util_hexdumpv;
l_util_debug;
l_util_get_debugfs_path;
+ l_util_pagesize;
l_memeq;
l_secure_memeq;
l_safe_atox8;
@@ -15,6 +15,7 @@
#include <limits.h>
#include <stdint.h>
#include <errno.h>
+#include <unistd.h>
#include "utf8.h"
#include "util.h"
@@ -812,3 +813,14 @@ LIB_EXPORT int l_safe_atox32(const char *s, uint32_t *out_x)
return safe_atou(s, 16, out_x);
}
+
+LIB_EXPORT size_t l_util_pagesize(void)
+{
+ static size_t page_size = 0;
+
+ if (likely(page_size > 0))
+ return page_size;
+
+ page_size = sysconf(_SC_PAGESIZE);
+ return page_size;
+}
@@ -515,6 +515,8 @@ int l_safe_atox32(const char *s, uint32_t *out_u);
int l_safe_atox16(const char *s, uint16_t *out_u);
int l_safe_atox8(const char *s, uint8_t *out_u);
+size_t l_util_pagesize(void);
+
#ifdef __cplusplus
}
#endif