From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvzIz-0005sT-4L for qemu-devel@nongnu.org; Fri, 10 Feb 2012 17:51:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvzIy-0005XA-0X for qemu-devel@nongnu.org; Fri, 10 Feb 2012 17:51:01 -0500 Received: from cantor2.suse.de ([195.135.220.15]:37400 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvzIx-0005X0-OK for qemu-devel@nongnu.org; Fri, 10 Feb 2012 17:50:59 -0500 Message-ID: <4F359F52.2000705@suse.de> Date: Fri, 10 Feb 2012 23:50:58 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1328814343-9189-1-git-send-email-paul@codesourcery.com> In-Reply-To: <1328814343-9189-1-git-send-email-paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] fstatat size mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Riku Voipio , qemu-devel@nongnu.org A "linux-user: " prefix for the subject would be nice, but let's wait for other comments first. Am 09.02.2012 20:05, schrieb Paul Brook: > host_to_target_stat64 is used for both stat64 and newfstatat syscalls. > In the latter case we don't actually have a struct stat64. > The current TARGET_ABI_BITS test is wrong for some 64-bit ILP32 targets > (in particular MIPS N32). Check for TARGET_NR_newfstatat instead. >=20 > This will all break horribly if both newfstatat and stat64 are defined, > so also add a check for that. >=20 > Signed-off-by: Paul Brook > --- CC'ing Riku. Andreas > linux-user/syscall.c | 12 +++++++++++- > 1 files changed, 11 insertions(+), 1 deletions(-) >=20 > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index ee32089..6e0999b 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -4474,6 +4474,16 @@ static inline abi_long host_to_target_timespec(a= bi_ulong target_addr, > return 0; > } > =20 > +/* The newfstatat syscall uses regular struct stat. However it never > + occurs on targets with a struct stat64. This allows us to share > + host_to_target_stat64 between newfstatat and fstatat64. */ > + > +#if defined(TARGET_NR_newfstatat) && (defined(TARGET_NR_fstatat64) \ > + || defined(TARGET_NR_stat64) || defined(TARGET_NR_fstat64) \ > + || defined(TARGET_NR_lstat64)) > +#error mismatched stat syscalls. > +#endif > + > #if defined(TARGET_NR_stat64) || defined(TARGET_NR_newfstatat) > static inline abi_long host_to_target_stat64(void *cpu_env, > abi_ulong target_addr, > @@ -4506,7 +4516,7 @@ static inline abi_long host_to_target_stat64(void= *cpu_env, > } else > #endif > { > -#if TARGET_ABI_BITS =3D=3D 64 && !defined(TARGET_ALPHA) > +#if defined(TARGET_NR_newfstatat) > struct target_stat *target_st; > #else > struct target_stat64 *target_st; --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg