1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)brk.2 6.3 (Berkeley) 5/22/86
7 .TH BRK 2 "May 22, 1986"
10 brk, sbrk \- change data segment size
16 int brk(char *\fIaddr\fP)
19 char *sbrk(int \fIincr\fP)
23 sets the system's idea of the lowest data segment
24 location not used by the program (called the break)
27 Locations greater than
29 and below the stack pointer
30 are not in the address space and will thus
31 cause a memory violation if accessed.
33 In the alternate function
36 more bytes are added to the
37 program's data space and a pointer to the
38 start of the new area is returned.
40 When a program begins execution via
42 the break is set at the
43 highest location defined by the program
44 and data storage areas.
45 Ordinarily, therefore, only programs with growing
46 data areas need to use
49 The address of the new break is returned if
53 if the program requests more
54 memory than the system limit.
58 if the break could not be set.
61 will fail and no additional memory will be allocated if
62 one of the following are true:
65 The maximum possible size of a data segment (as set by
70 Insufficient virtual memory space existed
71 to support the expansion. (Minix-vmd)
78 Minix-vmd rounds a small data segment limit up to 3 megabytes.
80 Setting the break may fail due to a temporary lack of
81 virtual memory under Minix-vmd. It is not possible to distinguish this
82 from a failure caused by exceeding the maximum size of
86 .\" $PchId: brk.2,v 1.2 2000/08/11 20:05:51 philip Exp $