VMS Help
CRTL, sbrk
*Conan The Librarian
|
Determines the lowest virtual address that is not used with the
program.
Format
#include <unistd.h>
void *sbrk (long int incr);
incr
The number of bytes to add to the current break address.
The sbrk function adds the number of bytes specified by its
argument to the current break address and returns the old break
address.
When a program is executed, the break address is set to the
highest location defined by the program and data storage areas.
Consequently, sbrk is needed only by programs that have growing
data areas.
sbrk(0) returns the current break address.
x The old break address.
(void *)(-1) Indicates that the program is requesting too
much memory.
Unlike other C library implementations, the Compaq C RTL memory
allocation functions (such as malloc) do not rely on brk or
sbrk to manage the program heap space. Consequently, on OpenVMS
systems, calling brk or sbrk can interfere with memory allocation
routines. The brk and sbrk functions are provided only for
compatibility purposes.