From 37f85e66e8f396b6f758e063531b95531aef628e Mon Sep 17 00:00:00 2001 From: cee1 Date: Fri, 18 Mar 2011 10:03:41 +0800 Subject: util: detect page size runtime. Some architectures support multiple machine types with diffenent page sizes, and some machine types even support multiple page sizes themselves. --- src/util.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 192ebff1fa..04afc731e9 100644 --- a/src/util.h +++ b/src/util.h @@ -83,6 +83,9 @@ struct timespec *timespec_store(struct timespec *ts, usec_t u); usec_t timeval_load(const struct timeval *tv); struct timeval *timeval_store(struct timeval *tv, usec_t u); +size_t page_size(void); +#define PAGE_ALIGN(l) ALIGN_TO((l), page_size()) + #define streq(a,b) (strcmp((a),(b)) == 0) #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) -- cgit v1.2.3-54-g00ecf