From: Tom Hughes Date: Mon, 7 Nov 2005 16:46:55 +0000 (+0000) Subject: Use sysconf to get the page size as it is more portable. X-Git-Tag: svn/VALGRIND_3_1_0~203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=142e43f15e3e06e2f8570e1c37caea2d700ed71f;p=thirdparty%2Fvalgrind.git Use sysconf to get the page size as it is more portable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5029 --- diff --git a/coregrind/launcher.c b/coregrind/launcher.c index 08a1792d9d..b994716d1d 100644 --- a/coregrind/launcher.c +++ b/coregrind/launcher.c @@ -105,6 +105,7 @@ static const char *select_platform(const char *clientname) int fd; unsigned char *header; const char *platform = NULL; + int32_t pagesize = sysconf(_SC_PAGESIZE); if (strchr(clientname, '/') == NULL) clientname = find_client(clientname); @@ -113,7 +114,7 @@ static const char *select_platform(const char *clientname) return NULL; // barf("open(%s): %s", clientname, strerror(errno)); - if ((header = mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0)) == MAP_FAILED) + if ((header = mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0)) == MAP_FAILED) return NULL; // barf("mmap(%s): %s", clientname, strerror(errno)); @@ -155,7 +156,7 @@ static const char *select_platform(const char *clientname) } } - munmap(header, PAGE_SIZE); + munmap(header, pagesize); return platform; }