qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] linux-user: fix QEMU_STRACE=1 segfault


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH V2] linux-user: fix QEMU_STRACE=1 segfault
Date: Mon, 21 Nov 2011 11:36:43 +0000

On 21 November 2011 10:52, Alexander Graf <address@hidden> wrote:
> On 21.11.2011, at 11:47, Peter Maydell wrote:
>> Should this really be printing -1 all the time when ret isn't -1 ?
>
> In linux-user, the syscall emulation functions return -errno which later
> gets translated to -1 with errno=-errno. That's why the code looks so
> weird. So yes, it's correct.

Yes, but the syscall ABI (which is what we're implementing) returns
-errno for errors; the errno variable is a purely userspace construct.
I'd expected that the strace layer would be tracing exactly what
the syscall ABI was.

However it looks like standard userspace strace(1) also does this
translation to -1 errno=thing, so it makes sense for us to do that too.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]