62 lines · 1.2 KB · Text
RawDownload
.TH BRK 2.SH NAMEbrk, sbrk \- change memory allocation.SH SYNOPSIS.B #include <u.h>.br.B #include <libc.h>.PP.ta \w'\fLvoid* 'u.Bint	brk(void *addr).PP.Bvoid*	sbrk(ulong incr).SH DESCRIPTION.I Brksets the system's idea of the lowest bss location not used by the program(called the break)to.I addrrounded up to the next multiple of 8 bytes.Locations not less than.I addrand below the stack pointermay cause a memory violation if accessed..PPIn the alternate function.IR sbrk ,.I incrmore bytes are added to theprogram's data space and a pointer to thestart of the new area is returned.Rounding occurs as with.IR brk ..PPWhen a program begins execution via.I execthe break is set at thehighest location defined by the programand data storage areas.Ordinarily, therefore, only programs with growingdata areas need to use.IR brk .A call to.I sbrkwith a zero argument returns the lowest addressin the dynamic segment..SH SOURCE.B /sys/src/libc/9sys/sbrk.c.SH SEE ALSO.IR intro (2),.IR malloc (2),.IR segattach (2),.IR segbrk (2).SH DIAGNOSTICSThese functions set.IR errstr ..PPThe error return from.I sbrkis.BR (void*)-1 .

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t