OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [sysvi386/] [sbrk.c] - Rev 1782

Compare with Previous | Blame | View Log

extern end;
 
static void *curbrk = (char*)&end;
 
void *
sbrk(incr)
int incr; {
	extern int errno;
	extern int _brk(void *);
	void *ptr = curbrk;
	int t;
 
	if (incr == 0)
		return curbrk;
	t = _brk (curbrk + incr);
	if (t == -1 && errno)
		return (void *)-1;
	curbrk = ((char *)curbrk) + incr;
	return ptr;
}
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.