/third_party/ltp/testcases/kernel/syscalls/epoll_ctl/ |
H A D | epoll_ctl02.c | 12 * - EBADF if epfd is an invalid fd. 16 * - EINVAL if fd is the same as epfd. 28 static int epfd; variable 38 int *epfd; member 45 {&inv, EPOLL_CTL_ADD, &fd[1], &events[1], EBADF, "epfd is an invalid fd"}, 46 {&epfd, EPOLL_CTL_ADD, &unsupported_fd, &events[1], EPERM, "fd does not support epoll"}, 47 {&epfd, EPOLL_CTL_ADD, &inv, &events[1], EBADF, "fd is an invalid fd"}, 48 {&epfd, -1, &fd[1], &events[1], EINVAL, "op is not supported"}, 49 {&epfd, EPOLL_CTL_ADD, &epfd, [all...] |
H A D | epoll_ctl04.c | 21 static int epfd, new_epfd; variable 32 for (depth = 0, epfd = fd[0]; depth < MAX_DEPTH; depth++) { in setup() 37 events.data.fd = epfd; in setup() 38 if (epoll_ctl(new_epfd, EPOLL_CTL_ADD, epfd, &events)) in setup() 41 epfd = new_epfd; in setup() 60 events.data.fd = epfd; in verify_epoll_ctl() 61 TST_EXP_FAIL(epoll_ctl(new_epfd, EPOLL_CTL_ADD, epfd, &events), EINVAL, in verify_epoll_ctl()
|
H A D | epoll_ctl03.c | 23 static int epfd, fds[2]; variable 42 TST_EXP_PASS(epoll_ctl(epfd, EPOLL_CTL_MOD, fds[0], &events), in run_all() 50 epfd = epoll_create(1); in setup() 51 if (epfd == -1) in setup() 57 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[0], &events)) in setup() 63 if (epfd) in cleanup() 64 SAFE_CLOSE(epfd); in cleanup()
|
H A D | epoll_ctl05.c | 22 static int epfd, origin_epfd, new_epfd; variable 33 for (i = 0, epfd = fd[0]; i < MAX_DEPTH; i++, epfd = new_epfd) { in setup() 41 events.data.fd = epfd; in setup() 42 if (epoll_ctl(new_epfd, EPOLL_CTL_ADD, epfd, &events)) in setup() 62 events.data.fd = epfd; in verify_epoll_ctl() 63 TST_EXP_FAIL(epoll_ctl(origin_epfd, EPOLL_CTL_ADD, epfd, &events), in verify_epoll_ctl()
|
H A D | epoll_ctl01.c | 25 static int epfd; variable 36 epfd = epoll_create(2); in setup() 37 if (epfd == -1) in setup() 49 if (epfd > 0) in cleanup() 50 SAFE_CLOSE(epfd); in cleanup() 90 res = epoll_wait(epfd, res_evs, 2, -1); in check_epoll_ctl() 125 TEST(epoll_ctl(epfd, opt, fd, epvs)); in opera_epoll_ctl()
|
/third_party/ltp/testcases/kernel/syscalls/epoll_wait/ |
H A D | epoll_wait03.c | 13 * - epoll_wait fails with EBADF if epfd is not a valid file descriptor. 14 * - epoll_wait fails with EINVAL if epfd is not an epoll file descriptor. 31 static int fds[2], epfd, inv_epfd, bad_epfd = -1; variable 34 int *epfd; member 40 {&bad_epfd, &ev_rdwr, 1, EBADF, "epfd is not a valid fd"}, 41 {&inv_epfd, &ev_rdwr, 1, EINVAL, "epfd is not an epoll fd"}, 42 {&epfd, &ev_rdwr, -1, EINVAL, "maxevents is less than zero"}, 43 {&epfd, &ev_rdwr, 0, EINVAL, "maxevents is equal to zero"}, 44 {&epfd, &ev_rdonly, 1, EFAULT, "events has no write permissions"} 53 epfd in setup() [all...] |
H A D | epoll_wait07.c | 20 static int epfd; variable 24 if (epfd > 0) in cleanup() 25 SAFE_CLOSE(epfd); in cleanup() 43 epfd = SAFE_EPOLL_CREATE1(0); in run() 45 SAFE_EPOLL_CTL(epfd, EPOLL_CTL_ADD, fds[0], &((struct epoll_event) { in run() 53 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 10, 0), 1); in run() 58 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 10, 0), 0); in run() 63 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 10, 0), 0); in run() 65 SAFE_CLOSE(epfd); in run()
|
H A D | epoll_wait06.c | 33 static int epfd; variable 48 if (epfd > 0) in cleanup() 49 SAFE_CLOSE(epfd); in cleanup() 65 epfd = SAFE_EPOLL_CREATE1(0); in run() 67 SAFE_EPOLL_CTL(epfd, EPOLL_CTL_ADD, fds[0], &((struct epoll_event) { in run() 71 SAFE_EPOLL_CTL(epfd, EPOLL_CTL_ADD, fds[1], &((struct epoll_event) { in run() 82 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 1, 0), 1); in run() 91 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 1, 0), 0); in run() 98 TST_EXP_EQ_LI(SAFE_EPOLL_WAIT(epfd, &evt_receive, 1, 0), 1); in run()
|
H A D | epoll_wait02.c | 20 static int epfd, fds[2]; variable 30 TEST(epoll_wait(epfd, epevs, 1, sleep_ms)); in sample_fn() 46 epfd = epoll_create(1); in setup() 47 if (epfd == -1) in setup() 52 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[0], &epevs[0])) in setup() 58 if (epfd > 0) in cleanup() 59 SAFE_CLOSE(epfd); in cleanup()
|
H A D | epoll_wait04.c | 20 static int epfd, fds[2]; variable 28 TEST(epoll_wait(epfd, epevs, 1, 0)); in run() 45 epfd = epoll_create(1); in setup() 46 if (epfd == -1) in setup() 51 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[0], &epevs[0])) in setup() 57 if (epfd > 0) in cleanup() 58 SAFE_CLOSE(epfd); in cleanup()
|
H A D | epoll_wait01.c | 22 static int write_size, epfd, fds[2]; variable 65 epfd = epoll_create(3); in setup() 66 if (epfd == -1) in setup() 70 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[0], &epevs[0]) || in setup() 71 epoll_ctl(epfd, EPOLL_CTL_ADD, fds[1], &epevs[1])) { in setup() 103 TEST(epoll_wait(epfd, &ret_evs, 1, -1)); in verify_epollout() 141 TEST(epoll_wait(epfd, &ret_evs, 1, -1)); in verify_epollin() 185 TEST(epoll_wait(epfd, ret_evs, 2, -1)); in verify_epollio() 221 if (epfd > 0) in cleanup() 222 SAFE_CLOSE(epfd); in cleanup() [all...] |
H A D | epoll_wait05.c | 17 static int epfd; variable 74 epfd = SAFE_EPOLL_CREATE1(0); in run() 76 SAFE_EPOLL_CTL(epfd, EPOLL_CTL_ADD, sockfd_client, &evt_req); in run() 81 ret = SAFE_EPOLL_WAIT(epfd, &evt_rec, 1, 2000); in run() 93 SAFE_CLOSE(epfd); in run() 116 if (fcntl(epfd, F_GETFD) > 0) in cleanup() 117 SAFE_CLOSE(epfd); in cleanup()
|
/third_party/alsa-utils/alsactl/ |
H A D | monitor.c | 242 static int operate_dispatcher(int epfd, uint32_t op, struct epoll_event *epev, in operate_dispatcher() argument 265 err = epoll_ctl(epfd, op, pfds[i].fd, epev); in operate_dispatcher() 274 static int prepare_dispatcher(int epfd, int sigfd, int infd, in prepare_dispatcher() argument 283 if (epoll_ctl(epfd, EPOLL_CTL_ADD, sigfd, &ev) < 0) in prepare_dispatcher() 288 if (epoll_ctl(epfd, EPOLL_CTL_ADD, infd, &ev) < 0) in prepare_dispatcher() 294 err = operate_dispatcher(epfd, EPOLL_CTL_ADD, &ev, entry); in prepare_dispatcher() 302 static int run_dispatcher(int epfd, int sigfd, int infd, struct list_head *srcs, in run_dispatcher() argument 322 count = epoll_wait(epfd, epev, max_ev_count, -1); in run_dispatcher() 349 operate_dispatcher(epfd, EPOLL_CTL_DEL, NULL, entry); in run_dispatcher() 359 static void clear_dispatcher(int epfd, in argument 396 int epfd; monitor() local [all...] |
/kernel/linux/linux-6.6/tools/thermal/lib/ |
H A D | mainloop.c | 11 static int epfd = -1; variable 31 if (epfd < 0) in mainloop() 36 nfds = epoll_wait(epfd, events, MAX_EVENTS, timeout); in mainloop() 82 if (epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &ev) < 0) { in mainloop_add() 95 if (epoll_ctl(epfd, EPOLL_CTL_DEL, fd, NULL) < 0) in mainloop_del() 105 epfd = epoll_create(2); in mainloop_init() 106 if (epfd < 0) in mainloop_init() 119 close(epfd); in mainloop_fini()
|
/third_party/ltp/include/ |
H A D | tst_epoll.h | 24 int epfd, int op, int fd, struct epoll_event *ev); 26 #define SAFE_EPOLL_CTL(epfd, op, fd, ev) \ 27 safe_epoll_ctl(__FILE__, __LINE__, epfd, op, fd, ev) 30 int epfd, struct epoll_event *events, 33 #define SAFE_EPOLL_WAIT(epfd, events, maxevents, timeout)\ 34 safe_epoll_wait(__FILE__, __LINE__, epfd, events, maxevents, timeout)
|
/third_party/ltp/lib/ |
H A D | tst_epoll.c | 37 int epfd, int op, int fd, struct epoll_event *ev) in safe_epoll_ctl() 56 ret = epoll_ctl(epfd, op, fd, ev); in safe_epoll_ctl() 61 "epoll_ctl(%d, %s, %d, ...", epfd, op_str, fd); in safe_epoll_ctl() 68 int epfd, struct epoll_event *events, in safe_epoll_wait() 71 int ret = epoll_wait(epfd, events, maxevents, timeout); in safe_epoll_wait() 76 epfd, maxevents, timeout); in safe_epoll_wait() 36 safe_epoll_ctl(const char *const file, const int lineno, int epfd, int op, int fd, struct epoll_event *ev) safe_epoll_ctl() argument 67 safe_epoll_wait(const char *const file, const int lineno, int epfd, struct epoll_event *events, int maxevents, int timeout) safe_epoll_wait() argument
|
/third_party/alsa-utils/axfer/ |
H A D | waiter-epoll.c | 20 int epfd; member 35 state->epfd = epoll_create(1); in epoll_prepare() 36 if (state->epfd < 0) in epoll_prepare() 44 if (epoll_ctl(state->epfd, EPOLL_CTL_ADD, ev.data.fd, &ev) < 0) in epoll_prepare() 59 err = epoll_wait(state->epfd, state->events, state->ev_count, in epoll_wait_event() 88 epoll_ctl(state->epfd, EPOLL_CTL_DEL, fd, NULL); in epoll_release() 94 close(state->epfd); in epoll_release() 97 state->epfd = 0; in epoll_release()
|
/third_party/ltp/include/lapi/ |
H A D | epoll.h | 24 static inline int epoll_pwait(int epfd, struct epoll_event *events, in epoll_pwait() argument 28 return tst_syscall(__NR_epoll_pwait, epfd, events, maxevents, in epoll_pwait() 40 static inline int epoll_pwait2(int epfd, struct epoll_event *events, in epoll_pwait2() argument 45 return tst_syscall(__NR_epoll_pwait2, epfd, events, maxevents, in epoll_pwait2() 53 return tst_syscall(__NR_epoll_pwait2, epfd, events, maxevents, in epoll_pwait2()
|
/third_party/ltp/testcases/kernel/syscalls/epoll_pwait/ |
H A D | epoll_pwait_var.h | 16 static int do_epoll_pwait(int epfd, struct epoll_event *events, int in do_epoll_pwait() argument 20 return epoll_pwait(epfd, events, maxevents, timeout, sigmask); in do_epoll_pwait() 25 return epoll_pwait2(epfd, events, maxevents, NULL, sigmask); in do_epoll_pwait() 31 return epoll_pwait2(epfd, events, maxevents, &ts, sigmask); in do_epoll_pwait()
|
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
H A D | reuseport_bpf_cpu.c | 151 void receive_on_cpu(int *rcv_fd, int len, int epfd, int cpu_id, int proto) in receive_on_cpu() argument 157 i = epoll_wait(epfd, &ev, 1, -1); in receive_on_cpu() 187 int epfd, cpu; in test() local 192 epfd = epoll_create(1); in test() 193 if (epfd < 0) in test() 198 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fd[cpu], &ev)) in test() 205 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 211 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 217 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 223 receive_on_cpu(rcv_fd, len, epfd, cp in test() [all...] |
H A D | reuseport_dualstack.c | 102 static int receive_once(int epfd, int proto) in receive_once() argument 108 i = epoll_wait(epfd, &ev, 1, -1); in receive_once() 131 int epfd, i, test_fd; in test() local 135 epfd = epoll_create(1); in test() 136 if (epfd < 0) in test() 142 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fds[i], &ev)) in test() 148 test_fd = receive_once(epfd, proto); in test() 156 close(epfd); in test()
|
H A D | reuseport_bpf_numa.c | 161 void receive_on_node(int *rcv_fd, int len, int epfd, int node_id, int proto) in receive_on_node() argument 167 i = epoll_wait(epfd, &ev, 1, -1); in receive_on_node() 197 int epfd, node; in test() local 202 epfd = epoll_create(1); in test() 203 if (epfd < 0) in test() 208 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fd[node], &ev)) in test() 215 receive_on_node(rcv_fd, len, epfd, node, proto); in test() 221 receive_on_node(rcv_fd, len, epfd, node, proto); in test() 224 close(epfd); in test()
|
/kernel/linux/linux-6.6/tools/testing/selftests/net/ |
H A D | reuseport_bpf_cpu.c | 151 void receive_on_cpu(int *rcv_fd, int len, int epfd, int cpu_id, int proto) in receive_on_cpu() argument 157 i = epoll_wait(epfd, &ev, 1, -1); in receive_on_cpu() 187 int epfd, cpu; in test() local 192 epfd = epoll_create(1); in test() 193 if (epfd < 0) in test() 198 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fd[cpu], &ev)) in test() 205 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 211 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 217 receive_on_cpu(rcv_fd, len, epfd, cpu, proto); in test() 223 receive_on_cpu(rcv_fd, len, epfd, cp in test() [all...] |
H A D | reuseport_dualstack.c | 102 static int receive_once(int epfd, int proto) in receive_once() argument 108 i = epoll_wait(epfd, &ev, 1, -1); in receive_once() 131 int epfd, i, test_fd; in test() local 135 epfd = epoll_create(1); in test() 136 if (epfd < 0) in test() 142 if (epoll_ctl(epfd, EPOLL_CTL_ADD, rcv_fds[i], &ev)) in test() 148 test_fd = receive_once(epfd, proto); in test() 156 close(epfd); in test()
|
/foundation/communication/wifi/wifi/base/cRPC/src/ |
H A D | evloop.c | 40 evLoop->epfd = -1; in CreateEventLoop() 53 evLoop->epfd = epoll_create(ELOOP_MAX_FD_SIZE); in CreateEventLoop() 54 if (evLoop->epfd == -1) { in CreateEventLoop() 82 if (loop->epfd != -1) { in DestroyEventLoop() 83 close(loop->epfd); in DestroyEventLoop() 128 if (epoll_ctl(loop->epfd, op, fd, &pollEvent) == -1) { in AddFdEvent() 165 if (epoll_ctl(loop->epfd, op, fd, &pollEvent) == -1) { in DelFdEvent()
|