From owner-freebsd-bugs Mon Nov 26 10:26:31 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 289B937B41A for ; Mon, 26 Nov 2001 10:26:25 -0800 (PST) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id fAQIQ7640183; Mon, 26 Nov 2001 20:26:07 +0200 (EET) (envelope-from ru) Date: Mon, 26 Nov 2001 20:26:07 +0200 From: Ruslan Ermilov To: David Malone Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: misc/32296: brk() has illegal prototype Message-ID: <20011126202607.B38902@sunbay.com> References: <200111261800.fAQI02494944@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200111261800.fAQI02494944@freefall.freebsd.org> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Nov 26, 2001 at 10:00:02AM -0800, David Malone wrote: > On Mon, Nov 26, 2001 at 05:40:08PM +0100, Joerg Schilling wrote: > > brk() always have been returning int and is supposed tto return int by the > > standard http://www.opengroup.org/onlinepubs/7908799/xsh/brk.html > > > > FreeBSD returns char * instead.... > > 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". :-) > What problems are you seeing with the current implimentation? The > only problem I can think of is that it will cause compiler warnings > if you do: > > if (brk(ptr) == -1) > > or if you try to redeclare brk. > FWIW, NetBSD has changed the brk()'s prototype to return "int". 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