aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/poll.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-08-31 11:16:57 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-09-06 00:34:59 -0400
commitb773ad40aca5bd755ba886620842f16e8fef6d75 (patch)
tree7065661f6559aff70244f2805ced48f894c9b38c /include/linux/poll.h
parentdf0cc0539b4127bd02f64de2c335b4af1fdb3845 (diff)
select: add poll_select_set_timeout() and poll_select_copy_remaining() helpers
This patch adds 2 helpers that will be used for the hrtimer based select/poll: poll_select_set_timeout() is a helper that takes a timeout (as a second, nanosecond pair) and turns that into a "struct timespec" that represents the absolute end time. This is a common operation in the many select() and poll() variants and needs various, common, sanity checks. poll_select_copy_remaining() is a helper that takes care of copying the remaining time to userspace, as select(), pselect() and ppoll() do. This function comes in both a natural and a compat implementation (due to datastructure differences). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Diffstat (limited to 'include/linux/poll.h')
-rw-r--r--include/linux/poll.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/poll.h b/include/linux/poll.h
index ef453828877a..f65de5128a9e 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -120,6 +120,8 @@ extern int do_sys_poll(struct pollfd __user * ufds, unsigned int nfds,
120extern int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, 120extern int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
121 fd_set __user *exp, s64 *timeout); 121 fd_set __user *exp, s64 *timeout);
122 122
123extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec);
124
123#endif /* KERNEL */ 125#endif /* KERNEL */
124 126
125#endif /* _LINUX_POLL_H */ 127#endif /* _LINUX_POLL_H */