shithub: riscv

Download patch

ref: 7bd6679c82079db20ea3a9b2b1f08406719b52ec
parent: 90ce513fb0df41c0d6c5cea8dbd612c1859d4392
author: cinap_lenrek <[email protected]>
date: Tue Jul 20 17:44:34 EDT 2021

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.

--- a/sys/man/2/brk
+++ b/sys/man/2/brk
@@ -43,7 +43,7 @@
 .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