/linux-6.12.1/tools/testing/selftests/net/ |
D | psock_fanout.c | 235 static int sock_fanout_read(int fds[], char *rings[], const int expect[]) in sock_fanout_read() argument 239 ret[0] = sock_fanout_read_ring(fds[0], rings[0]); in sock_fanout_read() 240 ret[1] = sock_fanout_read_ring(fds[1], rings[1]); in sock_fanout_read() 269 int fds[2]; in test_control_group() local 273 fds[0] = sock_fanout_open(PACKET_FANOUT_HASH, 0); in test_control_group() 274 if (fds[0] == -1) { in test_control_group() 292 fds[1] = sock_fanout_open(PACKET_FANOUT_HASH, 0); 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 [all …]
|
D | psock_lib.h | 77 static __maybe_unused void pair_udp_open(int fds[], uint16_t port) in pair_udp_open() argument 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() 113 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload) in pair_udp_send_char() argument 120 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char() 124 if (read(fds[1], rbuf, sizeof(rbuf)) != sizeof(rbuf)) { in pair_udp_send_char() [all …]
|
/linux-6.12.1/tools/bpf/bpftool/ |
D | common.c | 806 static int prog_fd_by_nametag(void *nametag, int **fds, bool tag) in prog_fd_by_nametag() argument 856 tmp = realloc(*fds, (nb_fds + 1) * sizeof(int)); in prog_fd_by_nametag() 861 *fds = tmp; in prog_fd_by_nametag() 863 (*fds)[nb_fds++] = fd; in prog_fd_by_nametag() 870 close((*fds)[nb_fds]); in prog_fd_by_nametag() 874 int prog_parse_fds(int *argc, char ***argv, int **fds) in prog_parse_fds() argument 889 (*fds)[0] = bpf_prog_get_fd_by_id(id); in prog_parse_fds() 890 if ((*fds)[0] < 0) { in prog_parse_fds() 908 return prog_fd_by_nametag(tag, fds, true); in prog_parse_fds() 921 return prog_fd_by_nametag(name, fds, false); in prog_parse_fds() [all …]
|
/linux-6.12.1/fs/ |
D | select.c | 411 #define FDS_IN(fds, n) (fds->in + n) argument 412 #define FDS_OUT(fds, n) (fds->out + n) argument 413 #define FDS_EX(fds, n) (fds->ex + n) argument 415 #define BITS(fds, n) (*FDS_IN(fds, n)|*FDS_OUT(fds, n)|*FDS_EX(fds, n)) argument 417 static int max_select_fd(unsigned long n, fd_set_bits *fds) in max_select_fd() argument 431 set &= BITS(fds, n); in max_select_fd() 441 set = BITS(fds, n); in max_select_fd() 476 static noinline_for_stack int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time) in do_select() argument 487 retval = max_select_fd(n, fds); in do_select() 509 inp = fds->in; outp = fds->out; exp = fds->ex; in do_select() [all …]
|
/linux-6.12.1/arch/um/os-Linux/ |
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()
|
D | sigio.c | 53 struct pollfds *fds, tmp; in write_sigio_thread() local 59 fds = ¤t_poll; in write_sigio_thread() 61 n = poll(fds->poll, fds->used, -1); in write_sigio_thread() 68 for (i = 0; i < fds->used; i++) { in write_sigio_thread() 69 p = &fds->poll[i]; in write_sigio_thread() 87 fds->used--; in write_sigio_thread() 88 memmove(&fds->poll[i], &fds->poll[i + 1], in write_sigio_thread() 89 (fds->used - i) * sizeof(*fds->poll)); in write_sigio_thread()
|
D | file.c | 386 int os_pipe(int *fds, int stream, int close_on_exec) in os_pipe() argument 390 err = socketpair(AF_UNIX, type, 0, fds); in os_pipe() 397 err = os_set_exec_close(fds[0]); in os_pipe() 401 err = os_set_exec_close(fds[1]); in os_pipe() 410 close(fds[1]); in os_pipe() 411 close(fds[0]); in os_pipe() 528 ssize_t os_rcv_fd_msg(int fd, int *fds, unsigned int n_fds, in os_rcv_fd_msg() argument 532 char buf[CMSG_SPACE(sizeof(*fds) * MAX_RCV_FDS)]; in os_rcv_fd_msg() 542 .msg_controllen = CMSG_SPACE(sizeof(*fds) * n_fds), in os_rcv_fd_msg() 559 memcpy(fds, CMSG_DATA(cmsg), cmsg->cmsg_len); in os_rcv_fd_msg() [all …]
|
/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/ |
D | sock_iter_batch.c | 18 int *fds[2] = {}; in do_test() local 25 for (i = 0; i < ARRAY_SIZE(fds); i++) { in do_test() 28 fds[i] = start_reuseport_server(AF_INET6, sock_type, "::1", 0, 0, in do_test() 30 if (!ASSERT_OK_PTR(fds[i], "start_reuseport_server")) in do_test() 32 local_port = get_socket_local_port(*fds[i]); in do_test() 75 free_fds(fds[first_idx], nr_soreuse); in do_test() 76 fds[first_idx] = NULL; in do_test() 103 for (i = 0; i < ARRAY_SIZE(fds); i++) in do_test() 104 free_fds(fds[i], nr_soreuse); in do_test()
|
/linux-6.12.1/arch/um/drivers/ |
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()
|
D | slirp_user.c | 52 int fds[2], 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() 64 pri->slave = fds[1]; in slirp_open() 69 return fds[0]; in slirp_open() 71 close(fds[0]); in slirp_open() 72 close(fds[1]); in slirp_open()
|
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()
|
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()
|
D | chan_user.c | 241 int fds[2], n, err, pid; in winch_tramp() local 244 err = os_pipe(fds, 1, 1); in winch_tramp() 252 .pipe_fd = fds[1] } ); in winch_tramp() 267 *fd_out = fds[0]; in winch_tramp() 268 n = read(fds[0], &c, sizeof(c)); in winch_tramp() 288 close(fds[1]); in winch_tramp() 289 close(fds[0]); in winch_tramp()
|
D | vector_kern.c | 350 mmsg_vector->msg_hdr.msg_name = vp->fds->remote_addr; in vector_enqueue() 351 mmsg_vector->msg_hdr.msg_namelen = vp->fds->remote_addr_size; in vector_enqueue() 416 vp->fds->tx_fd, in vector_send() 796 if (vp->fds != NULL) in vector_remove() 863 pkt_len = uml_vector_recvmsg(vp->fds->rx_fd, &hdr, 0); in vector_legacy_rx() 916 vp->fds->tx_fd, in writev_tx() 969 vp->fds->rx_fd, qi->mmsg_vector, budget, 0); in vector_mmsg_rx() 1046 deactivate_fd(vp->fds->rx_fd, vp->rx_irq); in vector_net_start_xmit() 1047 if ((vp->fds->rx_fd != vp->fds->tx_fd) && (vp->tx_irq != 0)) in vector_net_start_xmit() 1048 deactivate_fd(vp->fds->tx_fd, vp->tx_irq); in vector_net_start_xmit() [all …]
|
/linux-6.12.1/Documentation/translations/zh_CN/accounting/ |
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.12.1/tools/testing/selftests/pidfd/ |
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.12.1/tools/testing/selftests/bpf/benchs/ |
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()
|
/linux-6.12.1/tools/testing/vsock/ |
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() 223 bytes_read = read(fds.fd, data, buf_size_bytes); in run_receiver() 238 if (fds.revents & (POLLHUP | POLLRDHUP)) in run_receiver() 319 struct pollfd fds = { 0 }; in run_sender() local 321 fds.fd = fd; in run_sender() [all …]
|
D | vsock_test.c | 216 int fds[MULTICONN_NFDS]; in test_stream_multiconn_client() local 220 fds[i] = vsock_stream_connect(opts->peer_cid, opts->peer_port); in test_stream_multiconn_client() 221 if (fds[i] < 0) { in test_stream_multiconn_client() 229 recv_byte(fds[i], 1, 0); in test_stream_multiconn_client() 231 send_byte(fds[i], 1, 0); in test_stream_multiconn_client() 235 close(fds[i]); in test_stream_multiconn_client() 240 int fds[MULTICONN_NFDS]; in test_stream_multiconn_server() local 244 fds[i] = vsock_stream_accept(VMADDR_CID_ANY, opts->peer_port, NULL); in test_stream_multiconn_server() 245 if (fds[i] < 0) { in test_stream_multiconn_server() 253 send_byte(fds[i], 1, 0); in test_stream_multiconn_server() [all …]
|
/linux-6.12.1/samples/nitro_enclaves/ |
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() 228 printf("Poll received value 0x%x\n", fds[0].revents); 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() [all …]
|
/linux-6.12.1/tools/perf/bench/ |
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()
|
/linux-6.12.1/tools/testing/selftests/cgroup/ |
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.12.1/samples/cgroup/ |
D | memcg_event_listener.c | 229 struct pollfd fds[1]; in monitor_events() local 234 fds[0].fd = events->inotify_fd; in monitor_events() 235 fds[0].events = POLLIN; in monitor_events() 238 ret = poll(fds, ARRAY_SIZE(fds), -1); in monitor_events() 242 if (fds[0].revents & POLLERR) in monitor_events() 245 if (fds[0].revents & POLLIN) { in monitor_events() 250 length = read(fds[0].fd, buffer, INOTIFY_BUFFER_SIZE); in monitor_events()
|
/linux-6.12.1/tools/testing/selftests/bpf/ |
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() 193 fds[0] = start_server_addr(type, &addr, addrlen, &opts); in start_reuseport_server() 194 if (fds[0] == -1) in start_reuseport_server() 198 if (getsockname(fds[0], (struct sockaddr *)&addr, &addrlen)) in start_reuseport_server() 202 fds[nr_fds] = start_server_addr(type, &addr, addrlen, &opts); in start_reuseport_server() 203 if (fds[nr_fds] == -1) in start_reuseport_server() 207 return fds; in start_reuseport_server() 210 free_fds(fds, nr_fds); in start_reuseport_server() [all …]
|
/linux-6.12.1/drivers/vfio/cdx/ |
D | intr.c | 104 int32_t *fds) in vfio_cdx_msi_set_block() argument 112 int fd = fds ? fds[i] : -1; in vfio_cdx_msi_set_block() 161 s32 *fds = data; in vfio_cdx_set_msi_trigger() local 166 fds); in vfio_cdx_set_msi_trigger() 171 ret = vfio_cdx_msi_set_block(vdev, start, count, fds); in vfio_cdx_set_msi_trigger()
|