From owner-cvs-src@FreeBSD.ORG Tue Aug 19 15:02:49 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6DD116A4BF; Tue, 19 Aug 2003 15:02:49 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06F4343F75; Tue, 19 Aug 2003 15:02:49 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7JM2mwO012824; Tue, 19 Aug 2003 15:02:48 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7JM2m8j096370; Tue, 19 Aug 2003 15:02:48 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7JM2mCX096369; Tue, 19 Aug 2003 15:02:48 -0700 (PDT) (envelope-from marcel) Date: Tue, 19 Aug 2003 15:02:48 -0700 From: Marcel Moolenaar To: Garrett Wollman Message-ID: <20030819220248.GA91232@athlon.pn.xcllnt.net> References: <200308192039.h7JKdni9081097@repoman.freebsd.org> <20030819210421.GA28597@athlon.pn.xcllnt.net> <200308192132.h7JLWnZk035752@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200308192132.h7JLWnZk035752@khavrinen.lcs.mit.edu> User-Agent: Mutt/1.5.4i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/include unistd.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2003 22:02:50 -0000 On Tue, Aug 19, 2003 at 05:32:49PM -0400, Garrett Wollman wrote: > < said: > > > Changing the type of the namelen argument from int to size_t in > > at least the implementation of the function breaks the ABI on > > 64-bit platforms. The problem is that sign-extension is moved > > from the callee to the caller and previously compiled code will > > not have said sign-extension. > > Hmmm. I hadn't thought of that, but you're absolutely right. > Suggestions as to the best way to deal? (I want the type to be > correct going forward.) If we care about it (we may not, because I don't think it imposes a security problem) we could force the sign-extension in gethostname() by assigning namelen before we do anything else. Something like: int gethostname(name, namelen) char *name; size_t namelen; { int mib[2]; size_t size; /* * Preserve behaviour for when namelen was an int. * This avoids ABI breakages. */ namelen = (int)namelen; : : } I think that should do it. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net