diff options
author | Damien Miller <djm@mindrot.org> | 1999-12-28 10:19:16 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-12-28 10:19:16 +1100 |
commit | 13bc0be2b65b65ab7ac020bbd0a772ed3abe1738 (patch) | |
tree | 721e717913d8eda07e1fde46d1fdde31b9f2743c /bsd-snprintf.c | |
parent | 68e45de53b72087a77069a61c4e789e2012cd706 (diff) |
- Replacement for getpagesize() for systems which lack it
Diffstat (limited to 'bsd-snprintf.c')
-rw-r--r-- | bsd-snprintf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bsd-snprintf.c b/bsd-snprintf.c index e85d9296..81a4b284 100644 --- a/bsd-snprintf.c +++ b/bsd-snprintf.c @@ -54,6 +54,25 @@ static sigjmp_buf bail; #define EXTRABYTES 2 /* XXX: why 2? you don't want to know */ +#ifndef HAVE_GETPAGESIZE +int +getpagesize() +{ +#ifdef EXEC_PAGESIZE + return EXEC_PAGESIZE; +#else /* !EXEC_PAGESIZE */ +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* No CLSIZE */ + return NBPG * CLSIZE; +# else /* !NBPG */ + return NBPC; +# endif /* NBPG */ +#endif /* EXEC_PAGESIZE */ +} +#endif /* HAVE_GETPAGESIZE */ + static char * msetup(str, n) char *str; |