Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\select.c Create Date:2022-07-28 20:07:06
Last Modify:2020-03-18 10:25:38 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:We can actually return ERESTARTSYS instead of EINTR, but I'd* like to be certain this leads to no problems. So I return* EINTR just for safety.* Update: ERESTARTSYS breaks at least the xview clock binary, so

Proto:static int compat_core_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp, compat_ulong_t __user *exp, struct timespec64 *end_time)

Type:int

Parameter:

TypeParameterName
intn
compat_ulong_t __user *inp
compat_ulong_t __user *outp
compat_ulong_t __user *exp
struct timespec64 *end_time
1180  ret = -EINVAL
1184  If n < 0 Then Go to out_nofds
1188  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1189  fdt = files_fdtable(files)
1190  max_fds = max_fds
1191  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1192  If n > max_fds Then n = max_fds
1200  size = FDS_BYTES(n)
1201  bits = stack_fds
1202  If size > size of stack_fds / 6 Then
1203  bits = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1204  ret = -ENOMEM
1205  If Not bits Then Go to out_nofds
1208  in = bits
1209  out = bits + size
1210  ex = bits + 2 * size
1211  res_in = bits + 3 * size
1212  res_out = bits + 4 * size
1213  res_ex = bits + 5 * size
1215  If (ret = Ooo, nasty. We need here to frob 32-bit unsigned longs to* 64-bit unsigned longs.) || (ret = Ooo, nasty. We need here to frob 32-bit unsigned longs to* 64-bit unsigned longs.) || (ret = Ooo, nasty. We need here to frob 32-bit unsigned longs to* 64-bit unsigned longs.) Then Go to out
1219  zero_fd_set(n, res_in)
1220  zero_fd_set(n, res_out)
1221  zero_fd_set(n, res_ex)
1223  ret = do_select(n, & fds, end_time)
1225  If ret < 0 Then Go to out
1227  If Not ret Then
1228  ret = -start if no handler..
1229  If signal_pending(current process) Then Go to out
1231  ret = 0
1234  If compat_set_fd_set(n, inp, res_in) || compat_set_fd_set(n, outp, res_out) || compat_set_fd_set(n, exp, res_ex) Then ret = -EFAULT
1238  out :
1239  If bits != stack_fds Then kfree(bits)
1241  out_nofds :
1242  Return ret
Caller
NameDescribe
do_compat_select
do_compat_pselect