Design and approach
Preserve the requested duration across bounded waits (src/util/sock.cpp:168, head)
Capping the wait also changes its overall duration: requests longer than INT_MAX milliseconds become waits of about 24.8 days. In particular, bitcoin-cli maps -rpcclienttimeout=0 to five years, so an RPC that remains pending beyond the cap now times out despite the documented “no timeout” setting. Previously, on Linux, an oversized poll() argument happened to become negative and act as infinite. Bound each syscall wait, then repeat until the original duration or deadline expires. This preserves the requested semantics without passing an unsupported timeout to the syscall.