Skip to content
Commit 0f6bb195 authored by Andreas Schwab's avatar Andreas Schwab Committed by Laurent Vivier
Browse files

linux-user: Use getcwd syscall directly



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.

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.

Signed-off-by: default avatarAndreas Schwab <schwab@suse.de>
Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
Message-Id: <mvmmu3qplvi.fsf@suse.de>
[lv: updated description]
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 4d213001
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment