1BRK(2) System Calls Manual BRK(2)
2
3
4
6 brk, sbrk, break - change core allocation
7
9 char *brk(addr)
10
11 char *sbrk(incr)
12
14 Brk sets the system's idea of the lowest location not used by the pro‐
15 gram (called the break) to addr (rounded up to the next multiple of 64
16 bytes on the PDP11, 256 bytes on the Interdata 8/32, 512 bytes on the
17 VAX-11/780). Locations not less than addr and below the stack pointer
18 are not in the address space and will thus cause a memory violation if
19 accessed.
20
21 In the alternate function sbrk, incr more bytes are added to the pro‐
22 gram's data space and a pointer to the start of the new area is
23 returned.
24
25 When a program begins execution via exec the break is set at the high‐
26 est location defined by the program and data storage areas. Ordinar‐
27 ily, therefore, only programs with growing data areas need to use
28 break.
29
31 exec(2), malloc(3), end(3)
32
34 Zero is returned if the break could be set; -1 if the program requests
35 more memory than the system limit or if too many segmentation registers
36 would be required to implement the break.
37
39 Setting the break in the range 0177701 to 0177777 (on the PDP11) is the
40 same as setting it to zero.
41
43 (break = 17.)
44 sys break; addr
45
46 Break performs the function of brk. The name of the routine differs
47 from that in C for historical reasons.
48
49
50
51 BRK(2)