3 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
12 libc_hidden_proto(brk)
14 extern void * __curbrk;
15 libc_hidden_proto(__curbrk)
17 extern int __init_brk (void);
18 libc_hidden_proto(__init_brk)
19 extern void *_brk(void *ptr) attribute_hidden;
21 int brk(void * end_data_seg)
23 if (__init_brk () == 0)
25 __curbrk = _brk(end_data_seg);
26 if (__curbrk == end_data_seg)