/linux-6.3-rc2/tools/testing/selftests/net/ |
A D | psock_fanout.c | 269 int fds[2]; in test_control_group() local 274 if (fds[0] == -1) { in test_control_group() 293 if (fds[1] == -1) { in test_control_group() 297 if (close(fds[1]) || close(fds[0])) { in test_control_group() 306 int fds[3]; in test_control_group_max_num_members() local 319 if (fds[0] == -1) { in test_control_group_max_num_members() 347 if (close(fds[2]) || close(fds[1]) || close(fds[0])) { in test_control_group_max_num_members() 356 int fds[3]; in test_unique_fanout_group_ids() local 402 if (close(fds[0]) || close(fds[1]) || close(fds[2])) { in test_unique_fanout_group_ids() 422 if (fds[0] == -1 || fds[1] == -1) { in test_datapath() [all …]
|
A D | psock_lib.h | 79 fds[0] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open() 80 fds[1] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open() 81 if (fds[0] == -1 || fds[1] == -1) { in pair_udp_open() 97 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) { in pair_udp_open() 101 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open() 105 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) { in pair_udp_open() 118 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char() 135 return pair_udp_send_char(fds, num, DATA_CHAR); in pair_udp_send() 138 static __maybe_unused void pair_udp_close(int fds[]) in pair_udp_close() argument 140 close(fds[0]); in pair_udp_close() [all …]
|
/linux-6.3-rc2/tools/bpf/bpftool/ |
A D | common.c | 786 *fds = tmp; in prog_fd_by_nametag() 856 if ((*fds)[0] < 0) in prog_parse_fds() 867 int *fds = NULL; in prog_parse_fd() local 871 if (!fds) { in prog_parse_fd() 886 fd = fds[0]; in prog_parse_fd() 888 free(fds); in prog_parse_fd() 937 *fds = tmp; in map_fd_by_name() 1004 int *fds = NULL; in map_parse_fd() local 1008 if (!fds) { in map_parse_fd() 1023 fd = fds[0]; in map_parse_fd() [all …]
|
A D | map.c | 625 int *fds = NULL; in do_show_subset() local 629 fds = malloc(sizeof(int)); in do_show_subset() 630 if (!fds) { in do_show_subset() 646 close(fds[i]); in do_show_subset() 655 close(fds[i]); in do_show_subset() 661 free(fds); in do_show_subset() 893 int *fds = NULL; in do_dump() local 900 if (!fds) { in do_dump() 938 close(fds[i]); in do_dump() 947 close(fds[i]); in do_dump() [all …]
|
/linux-6.3-rc2/fs/ |
A D | select.c | 414 #define FDS_IN(fds, n) (fds->in + n) argument 415 #define FDS_OUT(fds, n) (fds->out + n) argument 416 #define FDS_EX(fds, n) (fds->ex + n) argument 418 #define BITS(fds, n) (*FDS_IN(fds, n)|*FDS_OUT(fds, n)|*FDS_EX(fds, n)) argument 434 set &= BITS(fds, n); in max_select_fd() 444 set = BITS(fds, n); in max_select_fd() 512 inp = fds->in; outp = fds->out; exp = fds->ex; in do_select() 513 rinp = fds->res_in; routp = fds->res_out; rexp = fds->res_ex; in do_select() 628 fd_set_bits fds; in core_sys_select() local 666 fds.in = bits; in core_sys_select() [all …]
|
/linux-6.3-rc2/arch/um/os-Linux/ |
A D | helper.c | 47 int pid, fds[2], ret, n; in run_helper() local 53 ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fds); in run_helper() 61 ret = os_set_exec_close(fds[1]); in run_helper() 72 data.fd = fds[1]; in run_helper() 83 close(fds[1]); in run_helper() 84 fds[1] = -1; in run_helper() 90 n = read(fds[0], &ret, sizeof(ret)); in run_helper() 110 if (fds[1] != -1) in run_helper() 111 close(fds[1]); in run_helper() 112 close(fds[0]); in run_helper()
|
A D | sigio.c | 54 struct pollfds *fds; in write_sigio_thread() local 60 fds = ¤t_poll; in write_sigio_thread() 62 n = poll(fds->poll, fds->used, -1); in write_sigio_thread() 69 for (i = 0; i < fds->used; i++) { in write_sigio_thread() 70 p = &fds->poll[i]; in write_sigio_thread() 86 fds->used--; in write_sigio_thread() 87 memmove(&fds->poll[i], &fds->poll[i + 1], in write_sigio_thread() 88 (fds->used - i) * sizeof(*fds->poll)); in write_sigio_thread()
|
A D | file.c | 375 int os_pipe(int *fds, int stream, int close_on_exec) in os_pipe() argument 379 err = socketpair(AF_UNIX, type, 0, fds); in os_pipe() 386 err = os_set_exec_close(fds[0]); in os_pipe() 390 err = os_set_exec_close(fds[1]); in os_pipe() 399 close(fds[1]); in os_pipe() 400 close(fds[0]); in os_pipe() 654 char control[CMSG_SPACE(sizeof(*fds) * OS_SENDMSG_MAX_FDS)]; in os_sendmsg_fds() 657 unsigned int fds_size = sizeof(*fds) * fds_num; in os_sendmsg_fds() 673 memcpy(CMSG_DATA(cmsg), fds, fds_size); in os_sendmsg_fds() 681 int os_poll(unsigned int n, const int *fds) in os_poll() argument [all …]
|
/linux-6.3-rc2/arch/um/drivers/ |
A D | ubd_user.c | 30 int pid, fds[2], err; in start_io_thread() local 32 err = os_pipe(fds, 1, 1); in start_io_thread() 38 kernel_fd = fds[0]; in start_io_thread() 41 *fd_out = fds[1]; in start_io_thread() 60 os_close_file(fds[0]); in start_io_thread() 61 os_close_file(fds[1]); in start_io_thread()
|
A D | slirp_user.c | 52 int fds[2], pid, err; in slirp_open() local 54 err = os_pipe(fds, 1, 1); in slirp_open() 58 err = slirp_tramp(pri->argw.argv, fds[1]); in slirp_open() 65 pri->slave = fds[1]; in slirp_open() 70 return fds[0]; in slirp_open() 72 close(fds[0]); in slirp_open() 73 close(fds[1]); in slirp_open()
|
A D | slip_user.c | 78 int pid, fds[2], err, output_len; in slip_tramp() local 80 err = os_pipe(fds, 1, 0); in slip_tramp() 89 pe_data.stdout_fd = fds[1]; in slip_tramp() 90 pe_data.close_me = fds[0]; in slip_tramp() 106 close(fds[1]); in slip_tramp() 107 read_output(fds[0], output, output_len); in slip_tramp() 111 close(fds[0]); in slip_tramp() 117 close(fds[0]); in slip_tramp() 118 close(fds[1]); in slip_tramp()
|
A D | net_user.c | 182 int pid, fds[2], err; in change_tramp() local 185 err = os_pipe(fds, 1, 0); in change_tramp() 191 pe_data.close_me = fds[0]; in change_tramp() 192 pe_data.stdout_fd = fds[1]; in change_tramp() 196 read_output(fds[0], output, output_len); in change_tramp() 198 close(fds[0]); in change_tramp() 199 close(fds[1]); in change_tramp()
|
A D | chan_user.c | 223 int fds[2], n, err, pid; in winch_tramp() local 226 err = os_pipe(fds, 1, 1); in winch_tramp() 234 .pipe_fd = fds[1] } ); in winch_tramp() 249 *fd_out = fds[0]; in winch_tramp() 250 n = read(fds[0], &c, sizeof(c)); in winch_tramp() 270 close(fds[1]); in winch_tramp() 271 close(fds[0]); in winch_tramp()
|
A D | vector_kern.c | 429 vp->fds->tx_fd, in vector_send() 804 if (vp->fds != NULL) in vector_remove() 924 vp->fds->tx_fd, in writev_tx() 1055 if ((vp->fds->rx_fd != vp->fds->tx_fd) && (vp->tx_irq != 0)) in vector_net_start_xmit() 1125 if (vp->fds == NULL) in vector_net_close() 1139 if (vp->fds->rx_fd > 0) { in vector_net_close() 1143 vp->fds->rx_fd = -1; in vector_net_close() 1147 vp->fds->tx_fd = -1; in vector_net_close() 1161 kfree(vp->fds); in vector_net_close() 1162 vp->fds = NULL; in vector_net_close() [all …]
|
/linux-6.3-rc2/tools/testing/selftests/bpf/ |
A D | network_helpers.c | 152 int *fds; in start_reuseport_server() local 160 fds = malloc(sizeof(*fds) * nr_listens); in start_reuseport_server() 161 if (!fds) in start_reuseport_server() 166 if (fds[0] == -1) in start_reuseport_server() 176 if (fds[nr_fds] == -1) in start_reuseport_server() 180 return fds; in start_reuseport_server() 183 free_fds(fds, nr_fds); in start_reuseport_server() 187 void free_fds(int *fds, unsigned int nr_close_fds) in free_fds() argument 189 if (fds) { in free_fds() 191 close(fds[--nr_close_fds]); in free_fds() [all …]
|
A D | xdp_hw_metadata.c | 195 struct pollfd fds[rxq + 1]; in verify_metadata() local 203 fds[i].fd = xsk_socket__fd(rx_xsk[i].socket); in verify_metadata() 204 fds[i].events = POLLIN; in verify_metadata() 205 fds[i].revents = 0; in verify_metadata() 208 fds[rxq].fd = server_fd; in verify_metadata() 209 fds[rxq].events = POLLIN; in verify_metadata() 210 fds[rxq].revents = 0; in verify_metadata() 214 ret = poll(fds, rxq + 1, 1000); in verify_metadata() 221 if (fds[rxq].revents) in verify_metadata() 225 if (fds[i].revents == 0) in verify_metadata()
|
/linux-6.3-rc2/Documentation/translations/zh_CN/accounting/ |
A D | psi.rst | 109 struct pollfd fds; 112 fds.fd = open("/proc/pressure/memory", O_RDWR | O_NONBLOCK); 113 if (fds.fd < 0) { 118 fds.events = POLLPRI; 120 if (write(fds.fd, trig, strlen(trig) + 1) < 0) { 128 n = poll(&fds, 1, -1); 133 if (fds.revents & POLLERR) { 137 if (fds.revents & POLLPRI) { 140 printf("unknown event received: 0x%x\n", fds.revents);
|
/linux-6.3-rc2/tools/testing/selftests/pidfd/ |
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()
|
/linux-6.3-rc2/samples/nitro_enclaves/ |
A D | ne_ioctl_sample.c | 199 struct pollfd fds[1] = {}; in ne_poll_enclave_fd() local 205 fds[0].fd = enclave_fd; in ne_poll_enclave_fd() 206 fds[0].events = POLLIN | POLLERR | POLLHUP; in ne_poll_enclave_fd() 212 rc = poll(fds, 1, NE_POLL_WAIT_TIME_MS); in ne_poll_enclave_fd() 230 if (fds[0].revents & POLLHUP) { in ne_poll_enclave_fd() 236 if (fds[0].revents & POLLNVAL) { in ne_poll_enclave_fd() 656 struct pollfd fds[1] = {}; in ne_start_enclave_check_booted() local 696 fds[0].fd = server_vsock_fd; in ne_start_enclave_check_booted() 697 fds[0].events = POLLIN; in ne_start_enclave_check_booted() 699 rc = poll(fds, 1, NE_POLL_WAIT_TIME_MS); in ne_start_enclave_check_booted() [all …]
|
/linux-6.3-rc2/tools/testing/vsock/ |
A D | vsock_test.c | 212 int fds[MULTICONN_NFDS]; in test_stream_multiconn_client() local 217 if (fds[i] < 0) { in test_stream_multiconn_client() 231 close(fds[i]); in test_stream_multiconn_client() 236 int fds[MULTICONN_NFDS]; in test_stream_multiconn_server() local 241 if (fds[i] < 0) { in test_stream_multiconn_server() 255 close(fds[i]); in test_stream_multiconn_server() 795 struct pollfd fds; in test_stream_poll_rcvlowat_client() local 815 fds.fd = fd; in test_stream_poll_rcvlowat_client() 826 if (fds.revents) { in test_stream_poll_rcvlowat_client() 828 fds.revents); in test_stream_poll_rcvlowat_client() [all …]
|
A D | vsock_perf.c | 200 struct pollfd fds = { 0 }; in run_receiver() local 202 fds.fd = client_fd; in run_receiver() 203 fds.events = POLLIN | POLLERR | in run_receiver() 206 if (poll(&fds, 1, -1) < 0) in run_receiver() 209 if (fds.revents & POLLERR) { in run_receiver() 214 if (fds.revents & POLLIN) { in run_receiver() 219 bytes_read = read(fds.fd, data, buf_size_bytes); in run_receiver() 234 if (fds.revents & (POLLHUP | POLLRDHUP)) in run_receiver()
|
/linux-6.3-rc2/tools/perf/bench/ |
A D | sched-messaging.c | 53 static void fdpair(int fds[2]) in fdpair() 56 if (pipe(fds) == 0) in fdpair() 59 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0) in fdpair() 205 int fds[2]; in group() local 213 fdpair(fds); in group() 216 ctx->in_fds[0] = fds[0]; in group() 217 ctx->in_fds[1] = fds[1]; in group() 223 snd_ctx->out_fds[i] = fds[1]; in group() 225 close(fds[0]); in group()
|
/linux-6.3-rc2/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()
|
/linux-6.3-rc2/tools/perf/tests/ |
A D | bpf.c | 44 int fds[2], i; in llseek_loop() local 46 fds[0] = open("/dev/null", O_RDONLY); in llseek_loop() 47 fds[1] = open("/dev/null", O_RDWR); in llseek_loop() 49 if (fds[0] < 0 || fds[1] < 0) in llseek_loop() 53 lseek(fds[i % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET); in llseek_loop() 54 lseek(fds[(i + 1) % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET); in llseek_loop() 56 close(fds[0]); in llseek_loop() 57 close(fds[1]); in llseek_loop()
|
/linux-6.3-rc2/tools/include/nolibc/ |
A D | types.h | 97 unsigned long fds[(FD_SETSIZE + FD_SETBITMASK) / FD_SETIDXMASK]; member 104 __set->fds[__fd / FD_SETIDXMASK] &= \ 112 __set->fds[__fd / FD_SETIDXMASK] |= \ 121 __r = !!(__set->fds[__fd / FD_SETIDXMASK] & \ 131 __set->fds[__idx] = 0; \
|