On Iau, 2005-11-10 at 16:49 -0800, Ulrich Drepper wrote:
On 11/10/05, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
No. The poll POSIX libc call takes an int. What the kernel ones doesThe issue is that if the high bits are not handled special then
with the top bits is irrelevant to applications.
somebody might cause problems. E.g., overflowing the division or so. Therefore the kernel has to sanitize the argument and then why not use
the easiest way to do this?
Why does the kernel have to sanitize the input. Last time I checked
undefined inputs gave undefined outputs in the standards. fopen(NULL,
NULL) seems to crash glibc for example.
The kernel has to behave correctly given valid sensible inputs. Masking
the top bits is not behaving correctly
"sleep ages"
"no I'll sleep a short time"
Surely it would be far better to do
if((timeout >> 31) >> 1) return -EINVAL;
for 64bit systems