]> git.lizzy.rs Git - plan9front.git/commitdiff
brk(2): sbrk(0) returns end address, not the base
authorcinap_lenrek <cinap_lenrek@felloff.net>
Tue, 20 Jul 2021 21:44:34 +0000 (21:44 +0000)
committercinap_lenrek <cinap_lenrek@felloff.net>
Tue, 20 Jul 2021 21:44:34 +0000 (21:44 +0000)
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.

sys/man/2/brk

index f916a6877ef8a74eed3a3b2b7d9ea1c7abe99c65..3dad1a7d25ef99cc8a39d569f2ee13811750ef64 100644 (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