diff options
author | Daniel Jordan <daniel.m.jordan@oracle.com> | 2018-06-07 16:22:49 -0400 |
---|---|---|
committer | Fengguang Wu <fengguang.wu@intel.com> | 2018-06-08 06:51:36 +0800 |
commit | f22de75338ff65d357364b4c973f79755cee43e1 (patch) | |
tree | 45be580e7cee4c9e9f4b34bca0f6e2a3cd959fa2 | |
parent | 144498144d363f9a8f998d12a619f5f86ec21ae7 (diff) | |
download | vm-scalability-f22de75338ff65d357364b4c973f79755cee43e1.tar.gz |
usemem: fix build on systems with old glibc's
Headers from old versions of glibc don't have MAP_HUGE_SHIFT, which
leads to this:
usemem.c:60:32: error: 'MAP_HUGE_SHIFT' undeclared (first use in this function)
#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
With newer glibc's, MAP_HUGE_SHIFT is pulled in thusly:
usemem.c
sys/mman.h
bits/mman.h
bits/mman-linux.h
# define MAP_HUGE_SHIFT 26
As a workaround, define MAP_HUGE_SHIFT manually just as usemem does with
MAP_HUGE_2MB. While we're at it, remove the unused definition of
MAP_HUGE_1GB. Tested on arch, debian, and oracle linux with
./usemem -UO $((2**21)).
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rw-r--r-- | usemem.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -56,12 +56,12 @@ #define MAX_POINTERS 32 +#ifndef MAP_HUGE_SHIFT +#define MAP_HUGE_SHIFT 26 +#endif #ifndef MAP_HUGE_2MB #define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) #endif -#ifndef MAP_HUGE_1GB -#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) -#endif char *ourname; int pagesize; |