BSD 4_3 release
[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
2ce81398 7#if defined(LIBC_SCCS) && !defined(lint)
95f51977 8static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86";
2ce81398 9#endif LIBC_SCCS and 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}