Subject: lib/2938: [dM] two manpage bugs in brk(2)/sbrk(2)
To: None <gnats-bugs@gnats.netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 11/14/1996 15:17:35
>Number:         2938
>Category:       lib
>Synopsis:       [dM] two manpage bugs in brk(2)/sbrk(2)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 14 12:35:00 1996
>Last-Modified:
>Originator:     der Mouse
>Organization:
	Dis-
>Release:        1.2_BETA
>Environment:
	Any (noticed on a 1.2 NetBSD/sparc machine)
	$NetBSD: brk.2,v 1.7 1995/02/27 12:31:57 cgd Exp $
	$NetBSD: unistd.h,v 1.31 1996/09/07 17:48:59 mycroft Exp $
>Description:
	brk(2)/sbrk(2) lists only <sys/types.h> in the "list of include
	files" position.  This is wrong because <sys/types.h> is
	unnecessary to use either of these calls, and it doesn't
	mention <unistd.h>, which is where the prototypes for them
	actually are.

	The prototype given in the manpage for brk() also disagrees
	with the prototype in <unistd.h>.  They agree that sbrk is
	"char *sbrk(int)" but the manpage says brk is "int brk(const
	char *)" and <unistd.h> says it's "char *brk (const char *)".
>How-To-Repeat:
	Compare brk(2) with <unistd.h> and <sys/types.h>;
	alternatively, write code based on the manpage, compile with
	-Wimplicit, wonder why it doesn't work, go looking, add
	<unistd.h>, compile again, get complaints about brk()....
>Fix:
	For the former, change the manpage to list <unistd.h> instead
	of <sys/types.h>.  For the latter, fix either the manpage or
	the include file, whichever is wrong.  (I'd be inclined to
	change the manpage, but I am not familiar with historical
	precedent on what type brk() returns.)

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     01 EE 31 F6 BB 0C 34 36  00 F3 7C 5A C1 A0 67 1D
>Audit-Trail:
>Unformatted: