NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/41094: sigtimedwait returns EAGAIN instead of EINVAL if timeout is invalid



Christos Zoulas wrote:
 |  However, the fix doesn't work if both tv_sec and tv_usec == LONG_MAX.
| | Reusing the mstohz definition from sys/sys/param.h, with hz set to 100, | I got: 2147483649147ms -> 100hz Does changing the mstohz(ms) to tstohz(&ts) work?

Updated the kernel, the function now waits indefinitely. Probably the timeout was rounded down to INT_MAX, but I can't tell as it's in the kernel.

For reference, looks like Linux performs some additional validation on the usec field:

sec = LONG_MAX, usec = 0: ok
sec = LONG_MAX, usec = 999999999: ok
sec = 0, usec = 1000000000: EINVAL
sec = LONG_MAX, usec = LONG_MAX: EINVAL



Home | Main Index | Thread Index | Old Index