diff options
| author | Andrew Morton <[email protected]> | 2006-02-11 17:55:52 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2006-02-11 21:41:11 -0800 |
| commit | 643a654540579b0dcc7a206a4a7475276a41aff0 (patch) | |
| tree | e31d40e4362e4dc7823b7290c0de2a9353d3d117 /scripts/basic | |
| parent | 33042a9ff4d126ba944b9dc3076665a2029e0a34 (diff) | |
[PATCH] select: fix returned timeval
With David Woodhouse <[email protected]>
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" <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Ulrich Drepper <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: george anzinger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions