On Fri, 20 Mar 2026 at 11:17, Sun Haoyu <[email protected]> wrote: > > The Linux kernel writes back the remaining timeout for select-family > syscalls in poll_select_finish(). If that writeback fails, it keeps > the original return value. > > However, QEMU only writes back the timeout on success. If the writeback > fails, QEMU returns -TARGET_EFAULT. This can lose the remaining > timeout and change the return value. > > Update do_select(), do_pselect6(), and do_ppoll() to always write back > the timeout to match the Linux kernel's behavior. If the timeout > writeback fails, keep the original return value. > > Tested with the issue reproducer. > > Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3343 > > Signed-off-by: Sun Haoyu <[email protected]> > ---
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
