the linux syscall treats this argument as having type int, so passing
extremely long buffer sizes would be misinterpreted by the kernel.
since "short reads" are always acceptable, just cap it down.
patch based on musl commit 3d178a7e2b75066593fbd5705742c5808395d90d