From: Andreas Schwab <schwab@suse.de>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user strace
Date: Sat, 21 Jul 2007 18:02:33 +0200 [thread overview]
Message-ID: <jevecdu4me.fsf@sykes.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0707210907290.13035@trantor.stuart.netsweng.com> (Stuart Anderson's message of "Sat\, 21 Jul 2007 09\:10\:27 -0400 \(EDT\)")
Stuart Anderson <anderson@netsweng.com> writes:
> On Fri, 20 Jul 2007, Andreas Schwab wrote:
>
>> Stuart Anderson <anderson@netsweng.com> writes:
>>
>>> Index: qemu/linux-user/syscall.c
>>> ===================================================================
>>> --- qemu.orig/linux-user/syscall.c 2007-07-19 01:42:43.000000000 -0400
>>> +++ qemu/linux-user/syscall.c 2007-07-19 01:43:18.000000000 -0400
>>> @@ -312,6 +312,11 @@
>>> return (unsigned long)ret >= (unsigned long)(-4096);
>>> }
>>>
>>> +char *target_strerror(int err)
>>> +{
>>> + return strerror(host_to_target_errno(err));
>>> +}
>>> +
>>
>> That looks backwards. strerror surely expects a host errno value, but
>> host_to_target_errno returns the errno value for the target, doesn't it?
>
> The function is called target_strerror() 8-).
That's the problem. It does not return the string associated with the
target errno, but something else.
> It is used to display the errno string for the target, not the
> host.
But strerror interprets its argument as the host's errno value. If
host_to_target_error maps ELOOP to TARGET_ELOOP, and TARGET_ELOOP
happens have be the same value as EBADFD, the function wil return
"Bad file descriptor" instead of "Too many levels of symbolic links".
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2007-07-21 16:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 19:05 [Qemu-devel] [PATCH] linux-user strace Stuart Anderson
2007-07-20 21:41 ` Andreas Schwab
2007-07-21 13:10 ` Stuart Anderson
2007-07-21 16:02 ` Andreas Schwab [this message]
2007-07-21 16:26 ` Stuart Anderson
-- strict thread matches above, loose matches on Subject: below --
2007-07-06 15:19 Stuart Anderson
2007-06-20 21:29 Stuart Anderson
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=jevecdu4me.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.