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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [sysvi386/] [sbrk.c] - Blame information for rev 438

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

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