machine/param.h is gone
[unix-history] / usr / src / lib / libc / gen / valloc.c
CommitLineData
bb0cfa24
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
455b164d 7#ifndef lint
bb0cfa24
DF
8static char sccsid[] = "@(#)valloc.c 5.1 (Berkeley) %G%";
9#endif not lint
feea7534
BJ
10
11char *malloc();
12
13char *
14valloc(i)
15 int i;
16{
8b4f574e 17 int valsiz = getpagesize(), j;
455b164d 18 char *cp = malloc(i + (valsiz-1));
feea7534 19
8b4f574e 20 j = ((int)cp + (valsiz-1)) &~ (valsiz-1);
feea7534
BJ
21 return ((char *)j);
22}