|
From: <sv...@va...> - 2005-11-07 16:47:04
|
Author: tom
Date: 2005-11-07 16:46:55 +0000 (Mon, 07 Nov 2005)
New Revision: 5029
Log:
Use sysconf to get the page size as it is more portable.
Modified:
trunk/coregrind/launcher.c
Modified: trunk/coregrind/launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/launcher.c 2005-11-07 15:48:31 UTC (rev 5028)
+++ trunk/coregrind/launcher.c 2005-11-07 16:46:55 UTC (rev 5029)
@@ -105,6 +105,7 @@
int fd;
unsigned char *header;
const char *platform =3D NULL;
+ int32_t pagesize =3D sysconf(_SC_PAGESIZE);
=20
if (strchr(clientname, '/') =3D=3D NULL)
clientname =3D find_client(clientname);
@@ -113,7 +114,7 @@
return NULL;
// barf("open(%s): %s", clientname, strerror(errno));
=20
- if ((header =3D mmap(NULL, PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVA=
TE, fd, 0)) =3D=3D MAP_FAILED)
+ if ((header =3D mmap(NULL, pagesize, PROT_READ|PROT_WRITE, MAP_PRIVAT=
E, fd, 0)) =3D=3D MAP_FAILED)
return NULL;
// barf("mmap(%s): %s", clientname, strerror(errno));
=20
@@ -155,7 +156,7 @@
}
}
=20
- munmap(header, PAGE_SIZE);
+ munmap(header, pagesize);
=20
return platform;
}
|