brk(2): sbrk(0) returns end address, not the base

sbrk(0) returns the current end address of the BSS segment,
not the base. This might have been confused with the behaviour
of segbrk(), which when given a zero address returns the base.
This commit is contained in:
cinap_lenrek 2021-07-20 21:44:34 +00:00
parent 90ce513fb0
commit 7bd6679c82

View file

@ -43,7 +43,7 @@ data areas need to use
.IR brk .
A call to
.I sbrk
with a zero argument returns the lowest address
with a zero argument returns the end address
in the dynamic segment.
.SH SOURCE
.B /sys/src/libc/9sys/sbrk.c