]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: Fix fcntl() and fcntl64() to return O_LARGEFILE for 32-bit targets
authorHelge Deller <deller@gmx.de>
Sat, 8 Jul 2023 05:00:25 +0000 (07:00 +0200)
committerHelge Deller <deller@gmx.de>
Sat, 8 Jul 2023 14:55:08 +0000 (16:55 +0200)
commite0ddf8eac9f83c0bc5a3d39605d873ee0fe53421
tree89a9572bb10672791a2a4f745499afca7784769a
parent97c81ef4b8e203d9620fd46e7eb77004563e3675
linux-user: Fix fcntl() and fcntl64() to return O_LARGEFILE for 32-bit targets

When running a 32-bit guest on a 64-bit host, fcntl[64](F_GETFL) should
return with the TARGET_O_LARGEFILE flag set, because all 64-bit hosts
support large files unconditionally.

But on 64-bit hosts, O_LARGEFILE has the value 0, so the flag
translation can't be done with the fcntl_flags_tbl[]. Instead add the
TARGET_O_LARGEFILE flag afterwards.

Note that for 64-bit guests the compiler will optimize away this code,
since TARGET_O_LARGEFILE is zero.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/syscall.c