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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [sysvi386/] [sbrk.c] - Blame information for rev 829

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
extern end;
2
 
3
static void *curbrk = (char*)&end;
4
 
5
void *
6
sbrk(incr)
7
int incr; {
8
        extern int errno;
9
        extern int _brk(void *);
10
        void *ptr = curbrk;
11
        int t;
12
 
13
        if (incr == 0)
14
                return curbrk;
15
        t = _brk (curbrk + incr);
16
        if (t == -1 && errno)
17
                return (void *)-1;
18
        curbrk = ((char *)curbrk) + incr;
19
        return ptr;
20
}
21
 

powered by: WebSVN 2.1.0

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