diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-09-04 20:44:36 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-09-04 20:44:36 +0000 |
commit | 9613b6597870a299954fad327b0dfbda8cf8a91b (patch) | |
tree | 700249be286ee2b011caf153de314e563e3148a3 /libc/stdlib/valloc.c | |
parent | 549d4751c6f57557920712cd8fcd19578c67345e (diff) |
Make sjhill happy, and revive memalign
-Erik
Diffstat (limited to 'libc/stdlib/valloc.c')
-rw-r--r-- | libc/stdlib/valloc.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/libc/stdlib/valloc.c b/libc/stdlib/valloc.c index bfb9efd2a..dceeaf857 100644 --- a/libc/stdlib/valloc.c +++ b/libc/stdlib/valloc.c @@ -21,41 +21,14 @@ Cambridge, MA 02139, USA. or (US mail) as Mike Haertel c/o Free Software Foundation. */ #include <stdlib.h> -#include "malloc.h" - -#ifdef emacs -#include "config.h" -#endif - -#ifdef __GNU_LIBRARY__ -extern size_t __getpagesize __P ((void)); -#else -#ifndef USG -extern size_t getpagesize __P ((void)); -#define __getpagesize() getpagesize() -#else -#include <sys/param.h> -#ifdef EXEC_PAGESIZE -#define __getpagesize() EXEC_PAGESIZE -#else /* No EXEC_PAGESIZE. */ -#ifdef NBPG -#ifndef CLSIZE -#define CLSIZE 1 -#endif /* No CLSIZE. */ -#define __getpagesize() (NBPG * CLSIZE) -#else /* No NBPG. */ -#define __getpagesize() NBPC -#endif /* NBPG. */ -#endif /* EXEC_PAGESIZE. */ -#endif /* USG. */ -#endif +#include <unistd.h> static size_t pagesize; __ptr_t valloc (size_t size) { if (pagesize == 0) - pagesize = __getpagesize (); + pagesize = getpagesize (); - return memalign (pagesize, size); + return memalign(pagesize, size); } |