.tf break IV 4/21/86
.sh NAME
break, brk, sbrk - change core allocation
.sh SYNOPSIS
char *brk(addr)
.s3
unsigned addr;
.s3
char *sbrk(incr)
.s3
int incr;
.ft R
.sh DESCRIPTION
Break sets the system's idea of the lowest location not used by the
program (called the break) to addr (rounded up to the next multiple of
512 bytes).  Locations not less than addr and below the stack pointer
are not in the address space and will thus cause a memory violation if
accessed.
.s3
From C, brk will set the break to addr.  The old break is returned.
.s3
In the alternate entry sbrk, incr more bytes are added to the program's
data space and a pointer to the start of the new area is returned.
.s3
When a program begins execution via exec the break is set at the
highest location defined by the program and data storage areas.
Ordinarily, therefore, only programs with growing data areas need to
use break.
.sh "SEE ALSO"
execv (IV), alloc (IVa)
.sh DIAGNOSTICS
The c-bit is set if the program requests more memory than the system
limit or if more than 8 segmentation registers would be required to
implement the break.  From C, -1 is returned for these errors.
.sh NOTES
Setting the break in the range 0177700 to 0177777 is the same as
setting it to zero.
.sh KSOS
Note that in KSOS, the system's memory grain size is 512 bytes as
opposed to the 64 bytes of UNIX.
