cap getdents length argument to INT_MAX

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 report and suggested change by Florian Weimer.
1 file changed