Commit Graph

17 Commits

Author SHA1 Message Date
christos 39d23ee140 Make ts2timo(9) always return the absolute start time if the start argument
is present, and handle the TIMER_ABSTIME case in nanosleep1(9).
2013-05-22 16:00:52 +00:00
bouyer 5e3e8c4055 ts2timo(): if TIMER_ABSTIME is set and start is not NULL, initialize
it to 0. Some callers (e.g. nanosleep1()) expect *start to always be
initialized and would use random values from stack otherwise.
While there, remove an always-true conditionnal.
2013-05-21 16:25:55 +00:00
christos 11c04fdfa0 undo previous and move the test to the timeout function since 0,0 means
disable timer/interval.
2013-04-01 16:37:22 +00:00
christos 7f7fe0a2eb do the timeout test centrally. 2013-04-01 15:46:46 +00:00
martin cf1df18e92 ts2timo: return ETIMEDOUT instead of failing an assertion when the
calculated difference to the target time is zero.
2013-04-01 12:31:34 +00:00
christos 2c8702f59e instead of doing the tests twice fix the *fix() routines to return ETIMEDOUT
if seconds are negative. Accorting to TOG, this is not an error as linux
claims. Also make an assert stricter.
2013-03-31 16:46:29 +00:00
martin 573f2396f8 Move clock_gettime1() to subr_time.c (which is included in rump kernels) 2013-03-29 10:34:12 +00:00
christos 4cec95f0ea Centralize the computation of struct timespec to the int timo.
Make lwp_park take the regular arguments for specifying what kind
of timeout we supply like clock_nanosleep(), namely clockid_t and flags.
2013-03-29 01:08:17 +00:00
christos 2e4fce7c78 Fix monotonic interval timers. 2011-12-18 22:30:25 +00:00
drochner cc068f7930 fix and cleanup for tvtohz():
-assume (KASSERT) that the timeval given is normalized, and remove
 some partial fixup which I don't see what it is good for
 (I'm ready to back that out if someone tells a reason)
-catch overflows due to conversion of time_t (from tv_sec) to
 integer -- this function doesn't do 64-bit arithmetics (which makes
 sense because relative times which don't fit into 32 bits can be
 considered nonsense here), and before a huge tv_sec could lead to
 a zero hz result, violating the caller's assumptions (in particular
 trigger a diagnostic panic in abstimeout2timo())
2011-01-26 19:15:13 +00:00
rmind 3144d8ae3f Revert rev1.6, it shall return ETIMEDOUT for pthread calls. 2010-04-26 16:26:11 +00:00
rmind 5b61593723 mq_timed{send,receive}: as required by POSIX, return EINVAL on invalid
timeout and thread would have blocked, instead of ETIMEDOUT.  Change is
to abstimeout2timo(), thus also affects _lwp_park(2).

Reported by Stathis Kamperis some months ago.
2010-04-23 19:29:23 +00:00
rmind b9a294cf04 - Move inittimeleft() and gettimeleft() to subr_time.c, where they belong.
- Move abstimeout2timo() there too and export.  Use it in lwp_park().
2009-11-01 21:46:09 +00:00
christos aa389c698d Use more timespecs internally. From Alexander Shishkin and me.
Welcome to 4.99.70, 30 more to go for 100.
2008-07-15 16:18:08 +00:00
yamt ad5800688c reduce #ifdef __HAVE_TIMECOUNTER. 2007-12-22 00:35:32 +00:00
ad 7d57af5baa Pull in sys/intr.h 2007-11-29 18:04:46 +00:00
pooka 5fbd525b19 Shuffle routines which just roll values around from kern_clock.c
and kern_time.c to subr_time.c.
2007-08-09 07:36:18 +00:00