chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: don't truncate description when using pager
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index 1febd073d2eeef37f9e7ecf99179ae711a7acbdd..fada69cf1a981893f85998ac2da465865a2d0074 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-61,6
+61,20
@@
#include "exit-status.h"
#include "hashmap.h"
#include "exit-status.h"
#include "hashmap.h"
+size_t page_size(void) {
+ static __thread size_t pgsz = 0;
+ long r;
+
+ if (pgsz)
+ return pgsz;
+
+ assert_se((r = sysconf(_SC_PAGESIZE)) > 0);
+
+ pgsz = (size_t) r;
+
+ return pgsz;
+}
+
bool streq_ptr(const char *a, const char *b) {
/* Like streq(), but tries to make sense of NULL pointers */
bool streq_ptr(const char *a, const char *b) {
/* Like streq(), but tries to make sense of NULL pointers */