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] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
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.