File:  [Net/2] / Net2 / tests / benchmarks / valloc.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:03:54 2018 UTC (8 years, 3 months ago) by root
Branches: MAIN, CSRG
CVS tags: Net2, HEAD
Net/2

char *
valloc(npages, pagesize)
	int npages;
	register int pagesize;
{
	int off;
	char *base, *sbrk();

	base = sbrk(0);
	off = (int)base & (pagesize - 1);
	if (off) {
		(void) sbrk(pagesize - off);
		base += pagesize - off;
	}
	if (sbrk(npages * pagesize) == (char *)-1)
		return ((char *)0);
	return (base);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.