On 21 November 2011 10:52, Alexander Graf <ag...@suse.de> 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