| /tools/testing/selftests/net/ |
| A D | psock_lib.h | 81 fds[0] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open() 82 fds[1] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open() 83 if (fds[0] == -1 || fds[1] == -1) { in pair_udp_open() 99 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) { in pair_udp_open() 103 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open() 107 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) { in pair_udp_open() 120 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char() 137 return pair_udp_send_char(fds, num, DATA_CHAR); in pair_udp_send() 140 static __maybe_unused void pair_udp_close(int fds[]) in pair_udp_close() argument 142 close(fds[0]); in pair_udp_close() [all …]
|
| A D | psock_fanout.c | 332 int fds[2]; in test_control_group() local 340 if (fds[0] == -1) { in test_control_group() 361 if (fds[1] == -1) { in test_control_group() 367 if (close(fds[1]) || close(fds[0])) { in test_control_group() 376 int fds[3]; in test_control_group_max_num_members() local 389 if (fds[0] == -1) { in test_control_group_max_num_members() 417 if (close(fds[2]) || close(fds[1]) || close(fds[0])) { in test_control_group_max_num_members() 426 int fds[3]; in test_unique_fanout_group_ids() local 472 if (close(fds[0]) || close(fds[1]) || close(fds[2])) { in test_unique_fanout_group_ids() 492 if (fds[0] == -1 || fds[1] == -1) { in test_datapath() [all …]
|
| A D | ip_local_port_range.c | 232 int fds[2], i; in TEST_F() local 236 for (i = 0; i < ARRAY_SIZE(fds); i++) { in TEST_F() 255 fds[i] = fd; in TEST_F() 258 for (i = 0; i < ARRAY_SIZE(fds); i++) in TEST_F() 259 ASSERT_TRUE(close(fds[i]) == 0) TH_LOG("#%d: close failed", i); in TEST_F() 310 int fds[8]; in TEST_F() local 312 for (i = 0; i < ARRAY_SIZE(fds); i++) { in TEST_F() 328 fds[i] = fd; in TEST_F() 349 for (i = 0; i < ARRAY_SIZE(fds); i++) { in TEST_F() 350 err = close(fds[i]); in TEST_F()
|
| /tools/include/nolibc/ |
| A D | poll.h | 24 int sys_poll(struct pollfd *fds, int nfds, int timeout) in sys_poll() argument 33 return my_syscall5(__NR_ppoll, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0); in sys_poll() 41 return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0); in sys_poll() 43 return my_syscall3(__NR_poll, fds, nfds, timeout); in sys_poll() 45 return __nolibc_enosys(__func__, fds, nfds, timeout); in sys_poll() 50 int poll(struct pollfd *fds, int nfds, int timeout) in poll() argument 52 return __sysret(sys_poll(fds, nfds, timeout)); in poll()
|
| A D | types.h | 123 unsigned long fds[(FD_SETSIZE + FD_SETBITMASK) / FD_SETIDXMASK]; member 130 __set->fds[__fd / FD_SETIDXMASK] &= \ 138 __set->fds[__fd / FD_SETIDXMASK] |= \ 147 __r = !!(__set->fds[__fd / FD_SETIDXMASK] & \ 157 __set->fds[__idx] = 0; \
|
| /tools/testing/selftests/pidfd/ |
| A D | pidfd_info_test.c | 203 struct pollfd fds = {}; in TEST_F() local 206 fds.events = POLLIN; in TEST_F() 282 fds.events = POLLIN; in TEST_F() 350 fds.events = POLLIN; in TEST_F() 351 fds.fd = pidfd_leader; in TEST_F() 462 fds.events = POLLIN; in TEST_F() 489 fds.events = POLLHUP; in TEST_F() 527 fds.events = POLLIN; in TEST_F() 618 fds.events = POLLIN; in TEST_F() 636 fds.events = POLLHUP; in TEST_F() [all …]
|
| A D | pidfd_poll_test.c | 28 struct pollfd fds; in main() local 32 fds.events = POLLIN; in main() 85 fds.fd = pidfd; in main() 86 nevents = poll(&fds, 1, -1); in main() 97 if (!(fds.revents & POLLIN)) in main() 100 fds.revents); in main()
|
| /tools/testing/selftests/bpf/ |
| A D | io_helpers.c | 10 fd_set fds; in read_with_timeout() local 13 FD_ZERO(&fds); in read_with_timeout() 14 FD_SET(fd, &fds); in read_with_timeout() 15 err = select(fd + 1, &fds, NULL, NULL, &tv); in read_with_timeout() 18 if (FD_ISSET(fd, &fds)) in read_with_timeout()
|
| A D | network_helpers.c | 181 int *fds; in start_reuseport_server() local 189 fds = malloc(sizeof(*fds) * nr_listens); in start_reuseport_server() 190 if (!fds) in start_reuseport_server() 194 if (fds[0] == -1) in start_reuseport_server() 207 return fds; in start_reuseport_server() 210 free_fds(fds, nr_fds); in start_reuseport_server() 216 if (fds) { in free_fds() 219 free(fds); in free_fds() 962 fd_set fds; in traffic_monitor_thread() local 967 FD_ZERO(&fds); in traffic_monitor_thread() [all …]
|
| /tools/bpf/bpftool/ |
| A D | common.c | 865 *fds = tmp; in prog_fd_by_nametag() 935 if ((*fds)[0] < 0) in prog_parse_fds() 946 int *fds = NULL; in prog_parse_fd() local 950 if (!fds) { in prog_parse_fd() 965 fd = fds[0]; in prog_parse_fd() 967 free(fds); in prog_parse_fd() 1033 *fds = tmp; in map_fd_by_name() 1107 int *fds = NULL; in map_parse_fd() local 1111 if (!fds) { in map_parse_fd() 1126 fd = fds[0]; in map_parse_fd() [all …]
|
| /tools/testing/selftests/bpf/benchs/ |
| A D | bench_local_storage_create.c | 13 int *fds; member 120 t->fds = malloc(batch_sz * sizeof(*t->fds)); in setup() 121 if (!t->fds) { in setup() 149 int *fds = t->fds; in sk_producer() local 154 fds[i] = socket(AF_INET6, SOCK_DGRAM, 0); in sk_producer() 155 if (fds[i] == -1) in sk_producer() 160 if (fds[i] != -1) in sk_producer() 161 close(fds[i]); in sk_producer()
|
| A D | bench_sockmap.c | 98 #define c1 fds[0] 99 #define p1 fds[1] 100 #define c2 fds[2] 101 #define p2 fds[3] 102 #define sfd fds[4] 103 int fds[5]; member 117 .fds = {0}, 127 for (i = 0; i < sizeof(ctx.fds); i++) { in bench_sockmap_prog_destroy() 128 if (ctx.fds[0] > 0) in bench_sockmap_prog_destroy() 129 close(ctx.fds[i]); in bench_sockmap_prog_destroy()
|
| /tools/testing/selftests/cgroup/ |
| A D | wait_inotify.c | 33 struct pollfd fds = { .events = POLLIN, }; in main() local 59 fds.fd = fd; in main() 65 int ret = poll(&fds, 1, 10000); in main() 73 if ((ret > 0) && (fds.revents & POLLIN)) in main()
|
| /tools/testing/vsock/ |
| A D | vsock_perf.c | 204 struct pollfd fds = { 0 }; in run_receiver() local 206 fds.fd = client_fd; in run_receiver() 207 fds.events = POLLIN | POLLERR | in run_receiver() 210 if (poll(&fds, 1, -1) < 0) in run_receiver() 213 if (fds.revents & POLLERR) { in run_receiver() 218 if (fds.revents & POLLIN) { in run_receiver() 238 if (fds.revents & (POLLHUP | POLLRDHUP)) in run_receiver() 329 struct pollfd fds = { 0 }; in run_sender() local 331 fds.fd = fd; in run_sender() 333 if (poll(&fds, 1, -1) < 0) { in run_sender() [all …]
|
| A D | vsock_test.c | 213 if (fds[i] < 0) { in test_stream_multiconn_client() 227 close(fds[i]); in test_stream_multiconn_client() 237 if (fds[i] < 0) { in test_stream_multiconn_server() 251 close(fds[i]); in test_stream_multiconn_server() 834 struct pollfd fds; in test_stream_poll_rcvlowat_client() local 850 fds.fd = fd; in test_stream_poll_rcvlowat_client() 863 fds.revents); in test_stream_poll_rcvlowat_client() 879 fds.revents); in test_stream_poll_rcvlowat_client() 1519 fds.fd = fd; in test_stream_credit_update_test() 1618 fds.fd = fd; in test_stream_msgzcopy_leak_errq_client() [all …]
|
| A D | vsock_test_zerocopy.c | 148 struct pollfd fds = { 0 }; in test_client() local 190 fds.fd = fd; in test_client() 191 fds.events = 0; in test_client() 193 if (poll(&fds, 1, POLL_TIMEOUT_MS) < 0) { in test_client() 198 if (fds.revents & POLLERR) { in test_client()
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | lwt_helpers.h | 74 fd_set fds; in wait_for_packet() local 76 FD_ZERO(&fds); in wait_for_packet() 82 FD_SET(fd, &fds); in wait_for_packet() 84 ret = select(1 + fd, &fds, NULL, NULL, &copied_timeout); in wait_for_packet()
|
| A D | sock_iter_batch.c | 94 if (was_seen(fds[i], counts, n)) in get_seen_socket() 116 if (fds[i] >= 0 && socket_cookie(fds[i]) == out.cookie) in get_nth_socket() 186 if (fds[i] < 0) in check_n_were_seen_once() 785 int *fds = NULL; in do_resume_test() local 814 tc->connections, fds, in do_resume_test() 847 free_fds(fds, tc->init_socks); in do_resume_test() 873 int *fds[2] = {}; in do_test() local 933 free_fds(fds[first_idx], nr_soreuse); in do_test() 934 fds[first_idx] = NULL; in do_test() 961 for (i = 0; i < ARRAY_SIZE(fds); i++) in do_test() [all …]
|
| /tools/perf/bench/ |
| A D | sched-messaging.c | 66 static void fdpair(int fds[2]) in fdpair() 69 if (pipe(fds) == 0) in fdpair() 72 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0) in fdpair() 224 int fds[2]; in group() local 233 fdpair(fds); in group() 236 ctx->in_fds[0] = fds[0]; in group() 237 ctx->in_fds[1] = fds[1]; in group() 243 snd_ctx->out_fds[i] = fds[1]; in group() 245 close(fds[0]); in group()
|
| /tools/testing/selftests/ublk/ |
| A D | common.c | 10 fsync(dev->fds[i]); in backing_file_tgt_deinit() 11 close(dev->fds[i]); in backing_file_tgt_deinit() 50 dev->fds[dev->nr_fds] = fd; in backing_file_tgt_init()
|
| /tools/testing/selftests/sync/ |
| A D | sync.c | 60 struct pollfd fds; in sync_wait() local 62 fds.fd = fd; in sync_wait() 63 fds.events = POLLIN | POLLERR; in sync_wait() 65 return poll(&fds, 1, timeout); in sync_wait()
|
| /tools/testing/selftests/powerpc/pmu/ebb/ |
| A D | ebb_on_child_test.c | 52 FAIL_IF(pipe(read_pipe.fds) == -1); in ebb_on_child() 53 FAIL_IF(pipe(write_pipe.fds) == -1); in ebb_on_child()
|
| A D | task_event_vs_ebb_test.c | 45 FAIL_IF(pipe(read_pipe.fds) == -1); in task_event_vs_ebb() 46 FAIL_IF(pipe(write_pipe.fds) == -1); in task_event_vs_ebb()
|
| A D | cpu_event_vs_ebb_test.c | 49 FAIL_IF(pipe(read_pipe.fds) == -1); in cpu_event_vs_ebb() 50 FAIL_IF(pipe(write_pipe.fds) == -1); in cpu_event_vs_ebb()
|
| A D | ebb_on_willing_child_test.c | 57 FAIL_IF(pipe(read_pipe.fds) == -1); in ebb_on_willing_child() 58 FAIL_IF(pipe(write_pipe.fds) == -1); in ebb_on_willing_child()
|