| Function report | 
| 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 activity | Download SCCT | Chinese | 
Name:do_select
Proto:static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| int | n | |
| fd_set_bits * | fds | |
| struct timespec64 * | end_time | 
| 481 | timed_out = 0 | 
| 482 | slack = 0 | 
| 483 | busy_flag = If net_busy_loop_on() Then POLL_BUSY_LOOP Else 0 | 
| 484 | busy_start = 0 | 
| 487 | retval = max_select_fd(n, fds) | 
| 494 | poll_initwait( & table) | 
| 496 | If end_time && Not seconds && Not nanoseconds Then | 
| 501 | If end_time && Not timed_out Then slack = select_estimate_accuracy(end_time) | 
| 504 | retval = 0 | 
| 505 | cycle | 
| 507 | bool can_busy_loop = false | 
| 513 | bit = 1 | 
| 519 | If all_bits == 0 Then | 
| 520 | i += BITS_PER_LONG | 
| 521 | Continue | 
| 524 | When j < BITS_PER_LONG cycle | 
| 531 | If file Then | 
| 537 | If mask & POLLIN_SET && in & bit Then | 
| 542 | If mask & POLLOUT_SET && out & bit Then | 
| 547 | If mask & POLLEX_SET && ex & bit Then | 
| 553 | If retval Then | 
| 554 | can_busy_loop = false | 
| 555 | busy_flag = 0 | 
| 561 | Else if busy_flag & mask Then can_busy_loop = true | 
| 572 | cond_resched() | 
| 574 | _qproc = NULL | 
| 575 | If retval || timed_out || signal_pending(current process) Then Break | 
| 577 | If error Then | 
| 583 | If can_busy_loop && Not need_resched() Then | 
| 584 | If Not busy_start Then | 
| 585 | busy_start = busy_loop_current_time() | 
| 586 | Continue | 
| 588 | If Not poll/select we use the global sysctl_net_ll_poll value Then Continue | 
| 591 | busy_flag = 0 | 
| 603 | If Not poll_schedule_timeout( & table, TASK_INTERRUPTIBLE, to, slack) Then timed_out = 1 | 
| 608 | poll_freewait( & table) | 
| 610 | Return retval | 
| Name | Describe | 
|---|---|
| core_sys_select | 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 | 
| compat_core_sys_select | 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 | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |