From 33776f88dc7a21766cda77b39d94c1b57a18ddc2 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Thu, 24 Jan 2002 12:11:31 +0000 Subject: Change brk's prototype from char *brk(const char *) to int brk(const void *) and sbrk's prototype from char *sbrk(int) to void *sbrk(intptr_t). This makes us more consistant with NetBSD and standards which include these functions. Bruce pointed out that ptrdiff_t would probably have been better than intptr_t, but this doesn't match other implimentations. Also remove local declarations of sbrk and unnecessary casting. PR: 32296 Tested by: Harti Brandt MFC after: 1 month --- lib/libc/sys/brk.2 | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/sys/brk.2 b/lib/libc/sys/brk.2 index ac3a8d8..2683fb4 100644 --- a/lib/libc/sys/brk.2 +++ b/lib/libc/sys/brk.2 @@ -42,11 +42,12 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In sys/types.h .In unistd.h -.Ft char * -.Fn brk "const char *addr" -.Ft char * -.Fn sbrk "int incr" +.Ft int +.Fn brk "const void *addr" +.Ft void * +.Fn sbrk "intptr_t incr" .Sh DESCRIPTION .Bf -symbolic The @@ -116,22 +117,13 @@ value is returned from a call to for the definition of .Va etext ) . .Sh RETURN VALUES -The -.Fn brk -function returns -.Po Vt "char *" Pc Ns 0 -if successful; -otherwise the value -.Po Vt "char *" Pc Ns \-1 -is returned and the global variable -.Va errno -is set to indicate the error. +.Rv -std brk .Pp The .Fn sbrk function returns the prior break value if successful; otherwise the value -.Po Vt "char *" Pc Ns \-1 +.Po Vt "void *" Pc Ns \-1 is returned and the global variable .Va errno is set to indicate the error. -- cgit v1.1