qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] linux-user: Use getcwd syscall directly


From: Andreas Schwab
Subject: Re: [PATCH] linux-user: Use getcwd syscall directly
Date: Tue, 07 Apr 2020 13:55:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.90 (gnu/linux)

On Apr 07 2020, Peter Maydell wrote:

> On Tue, 7 Apr 2020 at 11:37, Laurent Vivier <address@hidden> wrote:
>>
>> Le 06/04/2020 à 17:18, Andreas Schwab a écrit :
>> > The glibc getcwd function returns different errors than the getcwd
>> > syscall, which triggers an assertion failure in the glibc getcwd function
>> > when running under the emulation.
>
> What exactly are the differences in errors ?

It's ENAMETOOLONG vs. ERANGE.  When the syscall returns ENAMETOOLONG,
the glibc wrapper uses a fallback implementation that potentially
handles an unlimited path length, and returns with ERANGE if the
provided buffer is too small.  The qemu emulation cannot distinguish the
two cases, and thus always returns ERANGE.  This is unexpected by the
glibc wrapper.

Andreas.

-- 
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

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