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



The following reply was made to PR kern/41094; it has been noted by GNATS.

From: Matteo Beccati <matteo%beccati.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
 netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/41094: sigtimedwait returns EAGAIN instead of EINVAL if
 timeout is invalid
Date: Sun, 29 Mar 2009 19:07:05 +0200

 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