diff options
| author | Roland McGrath | 1993-07-30 22:30:50 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-07-30 22:30:50 +0000 |
| commit | bac7913ae4c9cb8a75a8758077aa94023449569b (patch) | |
| tree | 479e6a6d03769772684974a6bbcdbfea10bcc7bb /src | |
| parent | fcd737693e8e320acd70f91ec8e0728563244805 (diff) | |
| download | emacs-bac7913ae4c9cb8a75a8758077aa94023449569b.tar.gz emacs-bac7913ae4c9cb8a75a8758077aa94023449569b.zip | |
Initial revision
Diffstat (limited to 'src')
| -rw-r--r-- | src/getpagesize.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/getpagesize.h b/src/getpagesize.h new file mode 100644 index 00000000000..4e513c31ade --- /dev/null +++ b/src/getpagesize.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* Emulate getpagesize on systems that lack it. */ | ||
| 2 | |||
| 3 | #ifndef HAVE_GETPAGESIZE | ||
| 4 | |||
| 5 | #ifdef VMS | ||
| 6 | #define getpagesize() 512 | ||
| 7 | #endif | ||
| 8 | |||
| 9 | #ifdef HAVE_UNISTD_H | ||
| 10 | #include <unistd.h> | ||
| 11 | #endif | ||
| 12 | |||
| 13 | #ifdef _SC_PAGESIZE | ||
| 14 | #define getpagesize() sysconf(_SC_PAGESIZE) | ||
| 15 | #else | ||
| 16 | |||
| 17 | #include <sys/param.h> | ||
| 18 | |||
| 19 | #ifdef EXEC_PAGESIZE | ||
| 20 | #define getpagesize() EXEC_PAGESIZE | ||
| 21 | #else | ||
| 22 | #ifdef NBPG | ||
| 23 | #define getpagesize() NBPG * CLSIZE | ||
| 24 | #ifndef CLSIZE | ||
| 25 | #define CLSIZE 1 | ||
| 26 | #endif /* no CLSIZE */ | ||
| 27 | #else /* no NBPG */ | ||
| 28 | #ifdef NBPC | ||
| 29 | #define getpagesize() NBPC | ||
| 30 | #endif /* NBPC */ | ||
| 31 | #endif /* no NBPG */ | ||
| 32 | #endif /* no EXEC_PAGESIZE */ | ||
| 33 | #endif /* no _SC_PAGESIZE */ | ||
| 34 | |||
| 35 | #endif /* not HAVE_GETPAGESIZE */ | ||