函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\select.c Create Date:2022-07-29 10:37:02
Last Modify:2020-03-18 10:25:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timespec64 *end_time)

返回类型:int

参数:

类型参数名称
intn
fd_set __user *inp
fd_set __user *outp
fd_set __user *exp
struct timespec64 *end_time
632  ret等于负EINVAL
633  如果n小于0则转到:out_nofds
637  _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
638  fdt等于files_fdtable(files)
639  max_fds等于max_fds
640  _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()
641  如果n大于max_fdsn等于max_fds
649  size等于FDS_BYTES(n)
650  bits等于stack_fds
651  如果size大于stack_fds的长度除6则
653  ret等于负ENOMEM
654  如果size大于SIZE_MAX除6则转到:out_nofds
657  alloc_size等于6乘size
658  bits等于kvmalloc(alloc_size, GFP_KERNEL)
659  如果非bits则转到:out_nofds
662  in等于bits
663  out等于bitssize
664  ex等于bits加2乘size
665  res_in等于bits加3乘size
666  res_out等于bits加4乘size
667  res_ex等于bits加5乘size
669  如果ret等于Use "unsigned long" accesses to let user-mode fd_set's be long-aligned.ret等于Use "unsigned long" accesses to let user-mode fd_set's be long-aligned.ret等于Use "unsigned long" accesses to let user-mode fd_set's be long-aligned.则转到:out
673  zero_fd_set(n, res_in)
674  zero_fd_set(n, res_out)
675  zero_fd_set(n, res_ex)
677  ret等于do_select(n, & fds, end_time)
679  如果ret小于0则转到:out
681  如果非ret
682  ret等于负start if no handler..
683  如果signal_pending(当前进程)则转到:out
685  ret等于0
688  如果set_fd_set(n, inp, res_in)或set_fd_set(n, outp, res_out)或set_fd_set(n, exp, res_ex)则ret等于负EFAULT
693  out :
694  如果bits不等于stack_fdskvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
696  out_nofds :
697  返回:ret
调用者
名称描述
kern_select
do_pselect