Commit | Line | Data |
---|---|---|
cb67878b TL |
1 | .TH BRK 2 |
2 | .SH NAME | |
3 | brk, sbrk, break \- change core allocation | |
4 | .SH SYNOPSIS | |
5 | .B char *brk(addr) | |
6 | .PP | |
7 | .B char *sbrk(incr) | |
8 | .SH DESCRIPTION | |
9 | .I Brk | |
10 | sets the system's idea of the lowest location not used by the program | |
11 | (called the break) | |
12 | to | |
13 | .I addr | |
14 | (rounded up to the next multiple of 64 bytes | |
15 | on the PDP11, 256 bytes on the Interdata 8/32, | |
16 | and 512 bytes on a VAX-11). | |
17 | Locations not less than | |
18 | .I addr | |
19 | and below the stack pointer | |
20 | are not in the address space and will thus | |
21 | cause a memory violation if accessed. | |
22 | .PP | |
23 | In the alternate function | |
24 | .I sbrk, | |
25 | .I incr | |
26 | more bytes are added to the | |
27 | program's data space and a pointer to the | |
28 | start of the new area is returned. | |
29 | .PP | |
30 | When a program begins execution via | |
31 | .I exec | |
32 | the break is set at the | |
33 | highest location defined by the program | |
34 | and data storage areas. | |
35 | Ordinarily, therefore, only programs with growing | |
36 | data areas need to use | |
37 | .IR break . | |
38 | .SH "SEE ALSO" | |
39 | exec(2), | |
40 | malloc(3), | |
41 | end(3) | |
42 | .SH DIAGNOSTICS | |
43 | Zero is returned if the break could be set; | |
44 | \-1 if the program requests more | |
45 | memory than the system limit | |
46 | or if too many segmentation | |
47 | registers would be required to implement the break. | |
48 | .SH BUGS | |
49 | Setting the break in the range | |
50 | 0177701 to 0177777 (on the PDP11) is the same as setting it to zero. | |
51 | .SH "ASSEMBLER (PDP-11)" | |
52 | (break = 17.) | |
53 | .br | |
54 | .B sys break; addr | |
55 | .PP | |
56 | .I Break | |
57 | performs the function of | |
58 | .IR brk . | |
59 | The name of the routine differs from that in C | |
60 | for historical reasons. |