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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [uClibc/] [libc/] [sysdeps/] [linux/] [sh/] [brk.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/* From libc-5.3.12 */
2
 
3
#include <errno.h>
4
#include <unistd.h>
5
#include <sys/syscall.h>
6
 
7
extern void * ___brk_addr;
8
 
9
extern int __init_brk (void);
10
extern void *_brk(void *ptr);
11
 
12
int brk(void * end_data_seg)
13
{
14
    if (__init_brk () == 0)
15
    {
16
                ___brk_addr = _brk(end_data_seg);
17
                if (___brk_addr == end_data_seg)
18
                        return 0;
19
                __set_errno(ENOMEM);
20
    }
21
    return -1;
22
}

powered by: WebSVN 2.1.0

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