[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
brk() Change Data-Segment Space Allocation
#include <alloc.h>
int brk(endds);
void *endds; New ending address
brk() dynamically changes the amount of space allocated to the
calling program's data segment. It does this by resetting the
program's 'break value', which is the address of the first location
beyond the end of the data segment. brk() sets the 'break value' to
'endds'. The amount of allocated space increases as the break value
increases.
Returns: If successful, 0 is returned. On failure, -1 is returned
and 'errno' (defined in <stdlib.h>) is set to ENOMEM, not
enough core.
Notes: brk() will fail without making any changes is such a
change would result in more space being allocated than is
allowable.
See Also:
coreleft()
sbrk()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson