From owner-freebsd-current@FreeBSD.ORG Wed Feb 13 11:35:38 2008 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B942216A46D for ; Wed, 13 Feb 2008 11:35:38 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from mail.vega.ru (infra.dev.vega.ru [90.156.167.14]) by mx1.freebsd.org (Postfix) with ESMTP id 7688C13C4D5 for ; Wed, 13 Feb 2008 11:35:37 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from [87.242.97.68] (port=56838 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1JPFtn-000BBo-Qs; Wed, 13 Feb 2008 11:35:35 +0000 Received: from edoofus.dev.vega.ru (localhost [127.0.0.1]) by edoofus.dev.vega.ru (8.14.2/8.14.2) with ESMTP id m1DBZULt045492; Wed, 13 Feb 2008 14:35:30 +0300 (MSK) (envelope-from rermilov@team.vega.ru) Received: (from ru@localhost) by edoofus.dev.vega.ru (8.14.2/8.14.2/Submit) id m1DBZUVG045491; Wed, 13 Feb 2008 14:35:30 +0300 (MSK) (envelope-from rermilov@team.vega.ru) X-Authentication-Warning: edoofus.dev.vega.ru: ru set sender to rermilov@team.vega.ru using -f Date: Wed, 13 Feb 2008 14:35:30 +0300 From: Ruslan Ermilov To: Kostik Belousov Message-ID: <20080213113530.GB45243@team.vega.ru> References: <200802122009.m1CK94Y8026959@repoman.freebsd.org> <20080212200911.B49F416A51C@hub.freebsd.org> <20080212204803.GT57756@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080212204803.GT57756@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: current@FreeBSD.org Subject: Re: [src] cvs commit: src/include unistd.h src/lib/libc/sys readlink.2 src/sys/compat/freebsd32 syscalls.master src/sys/kern syscalls.master vfs_syscalls.c src/sys/sys syscallsubr.h X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2008 11:35:38 -0000 [ Replying to the list. ] On Tue, Feb 12, 2008 at 10:48:04PM +0200, Kostik Belousov wrote: > > -int readlink(const char *, char *, int); > > +ssize_t readlink(const char *, char *, size_t); > You do understand that this changes the ABI ? size_t and int have different > sizes on 64-bit arches, and now upper-half of the register used to pass > the third arg is used. Amd64, fortunately, makes very hard to load a > non-zero into the upper half, I am not so sure about IA64/sparc64. I considered that. I've tested locally on amd64 and sparc64, and ia64 on pluto2.freebsd.org. Since this is only a third argument, it's passed in a 64-bit register, and for any meaningful value of it (0 .. INT_MAX), there's no ABI change at all. I compared .s files. : // cc -S a.c ; mv a.s a.s~ ; cc -S -DNEW a.c ; diff -u a.s~ a.s : #include : #include : : #ifdef NEW : ssize_t readlink(const char *, char *, size_t); : #else : int readlink(const char *, char *, int); : #endif : : void : foo(void) : { : int i; : char buf[1024]; : : i = readlink("foo", buf, INT_MAX); : } > This change, IMHO, requires symbol version compat shims. I don't think so. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer