xref: /csrg-svn/lib/libc/gen/valloc.c (revision 26611)
121366Sdist /*
221366Sdist  * Copyright (c) 1980 Regents of the University of California.
321366Sdist  * All rights reserved.  The Berkeley software License Agreement
421366Sdist  * specifies the terms and conditions for redistribution.
521366Sdist  */
621366Sdist 
7*26611Sdonn #if defined(LIBC_SCCS) && !defined(lint)
8*26611Sdonn static char sccsid[] = "@(#)valloc.c	5.2 (Berkeley) 03/09/86";
9*26611Sdonn #endif LIBC_SCCS and not lint
101996Swnj 
111996Swnj char	*malloc();
121996Swnj 
131996Swnj char *
141996Swnj valloc(i)
151996Swnj 	int i;
161996Swnj {
1713564Ssam 	int valsiz = getpagesize(), j;
1813582Ssam 	char *cp = malloc(i + (valsiz-1));
191996Swnj 
2013564Ssam 	j = ((int)cp + (valsiz-1)) &~ (valsiz-1);
211996Swnj 	return ((char *)j);
221996Swnj }
23