aboutsummaryrefslogtreecommitdiff
path: root/gdb/gmalloc.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1991-04-24 19:18:42 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1991-04-24 19:18:42 +0000
commitbe11d1119afd609de48d162c8dd79e56fa98fe90 (patch)
tree2bb9774b5c566787d247902e2a15c4f42a122f36 /gdb/gmalloc.c
parenta71d17b1acb54dc98ab80cfdba36e84d56001b1e (diff)
downloadgdb-be11d1119afd609de48d162c8dd79e56fa98fe90.zip
gdb-be11d1119afd609de48d162c8dd79e56fa98fe90.tar.gz
gdb-be11d1119afd609de48d162c8dd79e56fa98fe90.tar.bz2
* gmalloc.c [!HAVE_GETPAGESIZE]: Try to figure out the pagesize.
Diffstat (limited to 'gdb/gmalloc.c')
-rwxr-xr-xgdb/gmalloc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gmalloc.c b/gdb/gmalloc.c
index 0468551..a201e9a 100755
--- a/gdb/gmalloc.c
+++ b/gdb/gmalloc.c
@@ -1093,6 +1093,39 @@ DEFUN(__default_morecore, (size), ptrdiff_t size)
#include <stdlib.h>
#endif /* __ONEFILE */
+/* Deal with page size. */
+#ifdef BSD
+#ifndef BSD4_1
+#define HAVE_GETPAGESIZE
+#endif
+#endif
+
+#ifndef HAVE_GETPAGESIZE
+
+#include <sys/param.h>
+
+#if !defined (PAGESIZE)
+#ifdef EXEC_PAGESIZE
+#define PAGESIZE EXEC_PAGESIZE
+#else
+#ifdef NBPG
+#define PAGESIZE NBPG * CLSIZE
+#ifndef CLSIZE
+#define CLSIZE 1
+#endif /* no CLSIZE */
+#else /* no NBPG */
+#define PAGESIZE NBPC
+#endif /* no NBPG */
+#endif /* no EXEC_PAGESIZE */
+#endif /* no PAGESIZE */
+
+size_t
+DEFUN_VOID(__getpagesize)
+{
+ return PAGESIZE;
+}
+#endif /* not HAVE_GETPAGESIZE */
+
extern size_t EXFUN(__getpagesize, (NOARGS));
static size_t pagesize;