qemu/linux-user
Andreas Schwab 0f6bb1958f 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: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <mvmmu3qplvi.fsf@suse.de>
[lv: updated description]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-07-27 22:05:34 +02:00
..
aarch64
alpha
arm linux-user/arm/signal.c: Drop TARGET_CONFIG_CPU_32 2020-05-21 22:05:27 +01:00
cris
generic linux-user: implement OFD locks 2020-06-05 21:23:22 +02:00
host
hppa
i386
m68k
microblaze
mips
mips64
nios2
openrisc
ppc target/ppc: Add support for scv and rfscv instructions 2020-05-27 15:29:24 +10:00
riscv
s390x
sh4
sparc linux-user/sparc64: Fix the handling of window spill trap 2020-06-29 13:00:23 +02:00
sparc64
tilegx
x86_64
xtensa
cpu_loop-common.h
elfload.c linux-user: don't use MAP_FIXED in pgd_find_hole_fallback 2020-07-27 09:41:18 +01:00
errno_defs.h
exit.c
fd-trans.c linux-user: add netlink RTM_SETLINK command 2020-07-13 21:26:33 +02:00
fd-trans.h
flat.h
flatload.c linux-user: completely re-write init_guest_space 2020-05-15 15:25:16 +01:00
ioctls.h linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS 2020-06-29 13:10:11 +02:00
linux_loop.h
linuxload.c
main.c linux-user: Ensure mmap_min_addr is non-zero 2020-07-27 22:02:40 +02:00
Makefile.objs
mmap.c linux-user: detect overflow of MAP_FIXED mmap 2020-06-08 17:04:19 +01:00
qemu.h linux-user: Add strace support for printing arguments of ioctl() 2020-07-04 18:08:51 +02:00
safe-syscall.S
signal-common.h
signal.c
socket.h
strace.c linux-user: fix print_syscall_err() when syscall returned value is negative 2020-07-14 09:29:14 +02:00
strace.list linux-user: Add strace support for printing arguments of ioctl() 2020-07-04 18:08:51 +02:00
syscall_defs.h linux-user: syscall: ioctls: support DRM_IOCTL_VERSION 2020-06-29 13:04:37 +02:00
syscall_types.h linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS 2020-06-29 13:10:11 +02:00
syscall.c linux-user: Use getcwd syscall directly 2020-07-27 22:05:34 +02:00
target_flat.h
trace-events
uaccess.c
uname.c
uname.h
vm86.c