Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2001 10:07:16 +0200
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: misc/32296: brk() has illegal prototype
Message-ID:  <20011127100716.A22667@sunbay.com>
In-Reply-To: <200111261959.aa10803@salmon.maths.tcd.ie>
References:  <20011126202607.B38902@sunbay.com> <200111261959.aa10803@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 26, 2001 at 07:59:29PM +0000, David Malone wrote:
> > >  brk seems to have been returning a char * on BSD for at least the
> > >  last 10 years. It makes more sense for it to return an int, but
> > >  that could cause binary compatability problems for platforms where
> > >  an int and a char * are not the same size (eg. the alpha).
> 
> > But it can't actually return a "char *", because all syscalls return
> > "int".  :-)
> 
> I did actually go check if there was any magic glue which did
> a case, but realised that I probably wouldn't be able to tell
> from the i386 assembly.
> 
> > FWIW, NetBSD has changed the brk()'s prototype to return "int".
> 
> I guess there is probably no harm in changing it then. As Joerg
> pointed out to me in private mail the bit pattern for 0 and -1 are
> the same in 2's compliment so as long as sizeof(int) >= sizeof(char
> *) then it's unlikely that we'll see any binary compatability
> problems.
> 
> I'll try building a world with the patch below and if there are
> no objections I'll commit them in a week or so.
> 
Cool, could you please also test with the return type of sbrk()
changed to "void *"?


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

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




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