Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:max_select_fd

Proto:static int max_select_fd(unsigned long n, fd_set_bits *fds)

Type:int

Parameter:

TypeParameterName
unsigned longn
fd_set_bits *fds
427  set = ~( ~0UL << (n & BITS_PER_LONG - 1 ))
428  n /= BITS_PER_LONG
429  fdt = files_fdtable(files)
430  open_fds = open_fds + n
431  max = 0
432  If set Then
433  set &= BITS(fds, n)
434  If set Then
435  If Not (set & ~open_fds) Then Go to get_max
437  Return -EBADF
440  When n cycle
441  open_fds--
442  n--
443  set = BITS(fds, n)
444  If Not set Then Continue
446  If set & ~open_fds Then Return -EBADF
448  If max Then Continue
450  get_max :
451  Do
452  max++
453  set >>= 1
454  When set cycle
455  max += n * BITS_PER_LONG
458  Return max
Caller
NameDescribe
do_select