• Home
  • Raw
  • Download

Lines Matching refs:n

413 #define FDS_IN(fds, n)		(fds->in + n)  argument
414 #define FDS_OUT(fds, n) (fds->out + n) argument
415 #define FDS_EX(fds, n) (fds->ex + n) argument
417 #define BITS(fds, n) (*FDS_IN(fds, n)|*FDS_OUT(fds, n)|*FDS_EX(fds, n)) argument
419 static int max_select_fd(unsigned long n, fd_set_bits *fds) in max_select_fd() argument
427 set = ~(~0UL << (n & (BITS_PER_LONG-1))); in max_select_fd()
428 n /= BITS_PER_LONG; in max_select_fd()
430 open_fds = fdt->open_fds + n; in max_select_fd()
433 set &= BITS(fds, n); in max_select_fd()
440 while (n) { in max_select_fd()
442 n--; in max_select_fd()
443 set = BITS(fds, n); in max_select_fd()
455 max += n * BITS_PER_LONG; in max_select_fd()
478 static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time) in do_select() argument
489 retval = max_select_fd(n, fds); in do_select()
494 n = retval; in do_select()
514 for (i = 0; i < n; ++rinp, ++routp, ++rexp) { in do_select()
528 if (i >= n) in do_select()
624 int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, in core_sys_select() argument
636 if (n < 0) in core_sys_select()
644 if (n > max_fds) in core_sys_select()
645 n = max_fds; in core_sys_select()
652 size = FDS_BYTES(n); in core_sys_select()
672 if ((ret = get_fd_set(n, inp, fds.in)) || in core_sys_select()
673 (ret = get_fd_set(n, outp, fds.out)) || in core_sys_select()
674 (ret = get_fd_set(n, exp, fds.ex))) in core_sys_select()
676 zero_fd_set(n, fds.res_in); in core_sys_select()
677 zero_fd_set(n, fds.res_out); in core_sys_select()
678 zero_fd_set(n, fds.res_ex); in core_sys_select()
680 ret = do_select(n, &fds, end_time); in core_sys_select()
691 if (set_fd_set(n, inp, fds.res_in) || in core_sys_select()
692 set_fd_set(n, outp, fds.res_out) || in core_sys_select()
693 set_fd_set(n, exp, fds.res_ex)) in core_sys_select()
703 static int kern_select(int n, fd_set __user *inp, fd_set __user *outp, in kern_select() argument
721 ret = core_sys_select(n, inp, outp, exp, to); in kern_select()
725 SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp, in SYSCALL_DEFINE5() argument
728 return kern_select(n, inp, outp, exp, tvp); in SYSCALL_DEFINE5()
731 static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp, in do_pselect() argument
762 ret = core_sys_select(n, inp, outp, exp, to); in do_pselect()
794 SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, in SYSCALL_DEFINE6() argument
803 return do_pselect(n, inp, outp, exp, tsp, x.p, x.size, PT_TIMESPEC); in SYSCALL_DEFINE6()
808 SYSCALL_DEFINE6(pselect6_time32, int, n, fd_set __user *, inp, fd_set __user *, outp, in SYSCALL_DEFINE6() argument
817 return do_pselect(n, inp, outp, exp, tsp, x.p, x.size, PT_OLD_TIMESPEC); in SYSCALL_DEFINE6()
824 unsigned long n; member
835 return kern_select(a.n, a.inp, a.outp, a.exp, a.tvp); in SYSCALL_DEFINE1()
1193 static int compat_core_sys_select(int n, compat_ulong_t __user *inp, in compat_core_sys_select() argument
1203 if (n < 0) in compat_core_sys_select()
1211 if (n > max_fds) in compat_core_sys_select()
1212 n = max_fds; in compat_core_sys_select()
1219 size = FDS_BYTES(n); in compat_core_sys_select()
1234 if ((ret = compat_get_fd_set(n, inp, fds.in)) || in compat_core_sys_select()
1235 (ret = compat_get_fd_set(n, outp, fds.out)) || in compat_core_sys_select()
1236 (ret = compat_get_fd_set(n, exp, fds.ex))) in compat_core_sys_select()
1238 zero_fd_set(n, fds.res_in); in compat_core_sys_select()
1239 zero_fd_set(n, fds.res_out); in compat_core_sys_select()
1240 zero_fd_set(n, fds.res_ex); in compat_core_sys_select()
1242 ret = do_select(n, &fds, end_time); in compat_core_sys_select()
1253 if (compat_set_fd_set(n, inp, fds.res_in) || in compat_core_sys_select()
1254 compat_set_fd_set(n, outp, fds.res_out) || in compat_core_sys_select()
1255 compat_set_fd_set(n, exp, fds.res_ex)) in compat_core_sys_select()
1264 static int do_compat_select(int n, compat_ulong_t __user *inp, in do_compat_select() argument
1283 ret = compat_core_sys_select(n, inp, outp, exp, to); in do_compat_select()
1287 COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp, in COMPAT_SYSCALL_DEFINE5() argument
1291 return do_compat_select(n, inp, outp, exp, tvp); in COMPAT_SYSCALL_DEFINE5()
1295 compat_ulong_t n; member
1308 return do_compat_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp), in COMPAT_SYSCALL_DEFINE1()
1312 static long do_compat_pselect(int n, compat_ulong_t __user *inp, in do_compat_pselect() argument
1343 ret = compat_core_sys_select(n, inp, outp, exp, to); in do_compat_pselect()
1367 COMPAT_SYSCALL_DEFINE6(pselect6_time64, int, n, compat_ulong_t __user *, inp, in COMPAT_SYSCALL_DEFINE6() argument
1376 return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(x.p), in COMPAT_SYSCALL_DEFINE6()
1382 COMPAT_SYSCALL_DEFINE6(pselect6_time32, int, n, compat_ulong_t __user *, inp, in COMPAT_SYSCALL_DEFINE6() argument
1391 return do_compat_pselect(n, inp, outp, exp, tsp, compat_ptr(x.p), in COMPAT_SYSCALL_DEFINE6()