Date: Wed, 13 Feb 2008 14:35:30 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Kostik Belousov <kostikbel@gmail.com> 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 Message-ID: <20080213113530.GB45243@team.vega.ru> In-Reply-To: <20080212204803.GT57756@deviant.kiev.zoral.com.ua> References: <200802122009.m1CK94Y8026959@repoman.freebsd.org> <20080212200911.B49F416A51C@hub.freebsd.org> <20080212204803.GT57756@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[ 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 <sys/types.h>
: #include <sys/limits.h>
:
: #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080213113530.GB45243>
