From 7bd6679c82079db20ea3a9b2b1f08406719b52ec Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 20 Jul 2021 21:44:34 +0000 Subject: [PATCH] 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. --- sys/man/2/brk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/man/2/brk b/sys/man/2/brk index f916a6877..3dad1a7d2 100644 --- a/sys/man/2/brk +++ b/sys/man/2/brk @@ -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 -- 2.44.0