bump version to 1.0.28
[uclibc-ng.git] / libc / stdlib / valloc.c
blobf01a332f561a5061848c4d4541ae92077d5f1df7
1 /* Allocate memory on a page boundary.
2 Copyright (C) 1991, 1992 Free Software Foundation, Inc.
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with this library; see the file COPYING.LIB. If
16 not, see <http://www.gnu.org/licenses/>.
18 The author may be reached (Email) at the address mike@@ai.mit.edu,
19 or (US mail) as Mike Haertel c/o Free Software Foundation. */
21 #include <stdlib.h>
22 #include <unistd.h>
23 #include <malloc.h>
26 static size_t pagesize;
28 __ptr_t valloc (size_t size)
30 if (pagesize == 0)
31 pagesize = getpagesize ();
33 return memalign(pagesize, size);