Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Sep 2001 11:28:01 +0400
From:      Yar Tikhiy <yar@freebsd.org>
To:        arch@freebsd.org, doc@freebsd.org
Subject:   brk(2) manpage seems erroneous and confusing
Message-ID:  <20010901112800.A26502@comp.chem.msu.su>

next in thread | raw e-mail | index | archive | help
Hi there,

A friend of mine who is a Unix newbie tried to study various ways
of memory allocation, and got confused by the brk(2) page. I read
it and became confused either.

The current version of the page contains a number doubtful and
ambiguous statements.  I've found at least six of them:

- brk() should return int, not char* - it's a problem of our unistd.h, too
- the break isn't the lowest address of the process' data segment
- the statement on "data addressing" is likely to be interpreted that
  one may address memory only between the break and the stack pointer
- sbrk() isn't described at all
- char* functions are said to return ints
- actually, sbrk() returns not new, but prior break value

Despites the page is of little use to programmers now, it has
certain historical value for those who wish to know how Unix
developed.

I'd suggest taking the brk(2) page from NetBSD, which language
looks much better.  If noone minds, I'll do that.  Of course, I'll
change the function prototypes in the manpage to match our unistd.h
unless we decide to fix the latter, too.

-- 
Yar

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010901112800.A26502>