45 #define HAVE_LINUX_EPOLL 47 #ifdef HAVE_LINUX_EPOLL 49 #include <sys/epoll.h> 70 memset (&e, 0,
sizeof (e));
97 struct epoll_event * e;
104 int timeout_ms, max_timeout_ms = 10;
110 timeout_ms = max_timeout_ms;
118 timeout_ms = timeout * 1e3;
121 timeout_ms =
clib_max (1, timeout_ms);
122 timeout_ms =
clib_min (max_timeout_ms, timeout_ms);
145 static sigset_t unblock_all_signals;
146 n_fds_ready = epoll_pwait (em->
epoll_fd,
150 &unblock_all_signals);
153 if (n_fds_ready < 0 && errno == ENOSYS)
155 n_fds_ready = epoll_wait (em->
epoll_fd,
175 for (e = em->
epoll_events; e < em->epoll_events + n_fds_ready; e++)
184 if (e->events & EPOLLIN)
187 n_errors += errors[n_errors] != 0;
189 if (e->events & EPOLLOUT)
192 n_errors += errors[n_errors] != 0;
200 n_errors += errors[n_errors] != 0;
207 for (i = 0; i < n_errors; i++)
219 .name =
"unix-epoll-input",
sll srl srl sll sra u16x4 i
unix_file_function_t * read_function
u64 cpu_time_next_process_ready
u32 input_main_loops_per_call
#define VLIB_INIT_FUNCTION(x)
#define clib_warning(format, args...)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
#define vlib_call_init_function(vm, x)
#define pool_elt_at_index(p, i)
unix_file_function_t * error_function
#define UNIX_FILE_EVENT_EDGE_TRIGGERED
#define clib_error_return_unix(e, args...)
always_inline word unix_error_is_fatal(word error)
always_inline u32 vlib_last_vectors_per_main_loop(vlib_main_t *vm)
always_inline void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
struct epoll_event * epoll_events
unix_file_function_t * write_function
#define UNIX_FILE_DATA_AVAILABLE_TO_WRITE
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 input_node_counts_by_state[VLIB_N_NODE_STATE]
vlib_node_main_t node_main
volatile u32 api_queue_nonempty
always_inline void unix_save_error(unix_main_t *um, clib_error_t *error)
void(* file_update)(unix_file_t *file, unix_file_update_type_t update_type)
#define VLIB_REGISTER_NODE(x,...)
always_inline u64 clib_cpu_time_now(void)