qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Paul Brook <paul@codesourcery.com>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] fstatat size mismatch
Date: Fri, 10 Feb 2012 23:50:58 +0100	[thread overview]
Message-ID: <4F359F52.2000705@suse.de> (raw)
In-Reply-To: <1328814343-9189-1-git-send-email-paul@codesourcery.com>

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.
> 
> This will all break horribly if both newfstatat and stat64 are defined,
> so also add a check for that.
> 
> Signed-off-by: Paul Brook <paul@codesourcery.com>
> ---

CC'ing Riku.

Andreas

>  linux-user/syscall.c |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
> 
> 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(abi_ulong target_addr,
>      return 0;
>  }
>  
> +/* 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 == 64 && !defined(TARGET_ALPHA)
> +#if defined(TARGET_NR_newfstatat)
>          struct target_stat *target_st;
>  #else
>          struct target_stat64 *target_st;

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

      reply	other threads:[~2012-02-10 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 19:05 [Qemu-devel] [PATCH] fstatat size mismatch Paul Brook
2012-02-10 22:50 ` Andreas Färber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F359F52.2000705@suse.de \
    --to=afaerber@suse.de \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).