Andrew Morton 643a654540 [PATCH] select: fix returned timeval
With David Woodhouse <dwmw2@infradead.org>

select() presently has a habit of increasing the value of the user's
`timeout' argument on return.

We were writing back a timeout larger than the original.  We _deliberately_
round up, since we know we must wait at _least_ as long as the caller asks
us to.

The patch adds a couple of helper functions for magnitude comparison of
timespecs and of timevals, and uses them to prevent the various poll and
select functions from returning a timeout which is larger than the one which
was passed in.

The patch also fixes a bug in compat_sys_pselect7(): it was adding the new
timeout value to the old one and was returning that.  It should just return
the new timeout value.

(We have various handy timespec/timeval-to-from-nsec conversion functions in
time.h.  But this code open-codes it all).

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andi Kleen <ak@muc.de>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: george anzinger <george@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-11 21:41:11 -08:00
..
2006-01-11 18:42:13 -08:00
2006-01-14 18:25:19 -08:00
2006-01-27 18:36:11 -08:00
2006-01-18 19:20:23 -08:00
2006-02-05 11:06:53 -08:00
2006-01-11 18:42:13 -08:00
2006-02-01 08:53:09 -08:00
2006-01-11 18:42:13 -08:00
2006-02-03 08:32:04 -08:00
2006-01-08 20:13:48 -08:00
2006-01-11 18:42:13 -08:00
2006-01-10 08:01:25 -08:00
2006-01-31 15:24:34 +01:00
2006-02-11 21:41:11 -08:00
2006-01-11 18:42:13 -08:00
2006-01-11 18:42:13 -08:00
2006-01-08 20:12:40 -08:00
2006-01-18 19:20:29 -08:00
2006-01-11 18:42:13 -08:00
2006-01-11 18:42:13 -08:00
2006-02-03 08:32:11 -08:00
2006-01-18 19:20:30 -08:00
2006-01-18 19:20:29 -08:00
2006-01-08 20:13:56 -08:00
2006-01-11 18:42:13 -08:00
2006-02-11 21:41:11 -08:00
2006-02-11 21:41:10 -08:00