aboutsummaryrefslogtreecommitdiffstats
path: root/fs/select.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/select.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'fs/select.c')
-rw-r--r--fs/select.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/select.c b/fs/select.c
index 500a669f7790..d33418fdc858 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -67,7 +67,7 @@ static long __estimate_accuracy(struct timespec *tv)
67 return slack; 67 return slack;
68} 68}
69 69
70static long estimate_accuracy(struct timespec *tv) 70long select_estimate_accuracy(struct timespec *tv)
71{ 71{
72 unsigned long ret; 72 unsigned long ret;
73 struct timespec now; 73 struct timespec now;
@@ -306,6 +306,8 @@ static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
306 rts.tv_sec = rts.tv_nsec = 0; 306 rts.tv_sec = rts.tv_nsec = 0;
307 307
308 if (timeval) { 308 if (timeval) {
309 if (sizeof(rtv) > sizeof(rtv.tv_sec) + sizeof(rtv.tv_usec))
310 memset(&rtv, 0, sizeof(rtv));
309 rtv.tv_sec = rts.tv_sec; 311 rtv.tv_sec = rts.tv_sec;
310 rtv.tv_usec = rts.tv_nsec / NSEC_PER_USEC; 312 rtv.tv_usec = rts.tv_nsec / NSEC_PER_USEC;
311 313
@@ -417,7 +419,7 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
417 } 419 }
418 420
419 if (end_time && !timed_out) 421 if (end_time && !timed_out)
420 slack = estimate_accuracy(end_time); 422 slack = select_estimate_accuracy(end_time);
421 423
422 retval = 0; 424 retval = 0;
423 for (;;) { 425 for (;;) {
@@ -515,9 +517,6 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
515 * Update: ERESTARTSYS breaks at least the xview clock binary, so 517 * Update: ERESTARTSYS breaks at least the xview clock binary, so
516 * I'm trying ERESTARTNOHAND which restart only when you want to. 518 * I'm trying ERESTARTNOHAND which restart only when you want to.
517 */ 519 */
518#define MAX_SELECT_SECONDS \
519 ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
520
521int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, 520int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
522 fd_set __user *exp, struct timespec *end_time) 521 fd_set __user *exp, struct timespec *end_time)
523{ 522{
@@ -769,7 +768,7 @@ static int do_poll(unsigned int nfds, struct poll_list *list,
769 } 768 }
770 769
771 if (end_time && !timed_out) 770 if (end_time && !timed_out)
772 slack = estimate_accuracy(end_time); 771 slack = select_estimate_accuracy(end_time);
773 772
774 for (;;) { 773 for (;;) {
775 struct poll_list *walk; 774 struct poll_list *walk;