Home
last modified time | relevance | path

Searched refs:fds (Results 1 – 17 of 17) sorted by relevance

/tools/testing/selftests/net/
Dpsock_lib.h89 static __maybe_unused void pair_udp_open(int fds[], uint16_t port) in pair_udp_open() argument
93 fds[0] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
94 fds[1] = socket(PF_INET, SOCK_DGRAM, 0); in pair_udp_open()
95 if (fds[0] == -1 || fds[1] == -1) { in pair_udp_open()
111 if (bind(fds[1], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
115 if (bind(fds[0], (void *) &saddr, sizeof(saddr))) { in pair_udp_open()
119 if (connect(fds[0], (void *) &daddr, sizeof(daddr))) { in pair_udp_open()
125 static __maybe_unused void pair_udp_send_char(int fds[], int num, char payload) in pair_udp_send_char() argument
132 if (write(fds[0], buf, sizeof(buf)) != sizeof(buf)) { in pair_udp_send_char()
136 if (read(fds[1], rbuf, sizeof(rbuf)) != sizeof(rbuf)) { in pair_udp_send_char()
[all …]
Dpsock_fanout.c220 static int sock_fanout_read(int fds[], char *rings[], const int expect[]) in sock_fanout_read() argument
224 ret[0] = sock_fanout_read_ring(fds[0], rings[0]); in sock_fanout_read()
225 ret[1] = sock_fanout_read_ring(fds[1], rings[1]); in sock_fanout_read()
254 int fds[2]; in test_control_group() local
258 fds[0] = sock_fanout_open(PACKET_FANOUT_HASH, 0); in test_control_group()
259 if (fds[0] == -1) { in test_control_group()
277 fds[1] = sock_fanout_open(PACKET_FANOUT_HASH, 0); in test_control_group()
278 if (fds[1] == -1) { in test_control_group()
282 if (close(fds[1]) || close(fds[0])) { in test_control_group()
291 int fds[3]; in test_unique_fanout_group_ids() local
[all …]
/tools/perf/bench/
Dsched-messaging.c56 static void fdpair(int fds[2]) in fdpair()
59 if (pipe(fds) == 0) in fdpair()
62 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0) in fdpair()
208 int fds[2]; in group() local
216 fdpair(fds); in group()
219 ctx->in_fds[0] = fds[0]; in group()
220 ctx->in_fds[1] = fds[1]; in group()
226 snd_ctx->out_fds[i] = fds[1]; in group()
228 close(fds[0]); in group()
/tools/perf/tests/
Dbpf.c36 int fds[2], i; in llseek_loop() local
38 fds[0] = open("/dev/null", O_RDONLY); in llseek_loop()
39 fds[1] = open("/dev/null", O_RDWR); in llseek_loop()
41 if (fds[0] < 0 || fds[1] < 0) in llseek_loop()
45 lseek(fds[i % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET); in llseek_loop()
46 lseek(fds[(i + 1) % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET); in llseek_loop()
48 close(fds[0]); in llseek_loop()
49 close(fds[1]); in llseek_loop()
/tools/testing/selftests/sync/
Dsync.c60 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/
Debb_on_child_test.c52 FAIL_IF(pipe(read_pipe.fds) == -1); in ebb_on_child()
53 FAIL_IF(pipe(write_pipe.fds) == -1); in ebb_on_child()
Dtask_event_vs_ebb_test.c45 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()
Debb_on_willing_child_test.c59 FAIL_IF(pipe(read_pipe.fds) == -1); in ebb_on_willing_child()
60 FAIL_IF(pipe(write_pipe.fds) == -1); in ebb_on_willing_child()
Dcpu_event_vs_ebb_test.c50 FAIL_IF(pipe(read_pipe.fds) == -1); in cpu_event_vs_ebb()
51 FAIL_IF(pipe(write_pipe.fds) == -1); in cpu_event_vs_ebb()
Debb_vs_cpu_event_test.c50 FAIL_IF(pipe(read_pipe.fds) == -1); in ebb_vs_cpu_event()
51 FAIL_IF(pipe(write_pipe.fds) == -1); in ebb_vs_cpu_event()
Dtask_event_pinned_vs_ebb_test.c47 FAIL_IF(pipe(read_pipe.fds) == -1); in task_event_pinned_vs_ebb()
48 FAIL_IF(pipe(write_pipe.fds) == -1); in task_event_pinned_vs_ebb()
Dcpu_event_pinned_vs_ebb_test.c52 FAIL_IF(pipe(read_pipe.fds) == -1); in cpu_event_pinned_vs_ebb()
53 FAIL_IF(pipe(write_pipe.fds) == -1); in cpu_event_pinned_vs_ebb()
/tools/virtio/
Dvirtio_test.c38 struct pollfd fds[1]; member
109 dev->fds[info->idx].fd = info->call; in vq_info_add()
110 dev->fds[info->idx].events = POLLIN; in vq_info_add()
147 poll(dev->fds, dev->nvqs, -1); in wait_for_interrupt()
149 if (dev->fds[i].revents & POLLIN) { in wait_for_interrupt()
150 read(dev->fds[i].fd, &val, sizeof val); in wait_for_interrupt()
/tools/usb/usbip/src/
Dusbipd.c495 struct pollfd *fds; in do_standalone_mode() local
544 fds = calloc(nsockfd, sizeof(struct pollfd)); in do_standalone_mode()
546 fds[i].fd = sockfdlist[i]; in do_standalone_mode()
547 fds[i].events = POLLIN; in do_standalone_mode()
560 r = ppoll(fds, nsockfd, &timeout, &sigmask); in do_standalone_mode()
566 if (fds[i].revents & POLLIN) { in do_standalone_mode()
578 free(fds); in do_standalone_mode()
/tools/testing/selftests/powerpc/pmu/
Dlib.h19 int fds[2]; member
Dlib.c126 if (pipe(read_pipe.fds) == -1) in eat_cpu()
129 if (pipe(write_pipe.fds) == -1) in eat_cpu()
/tools/lib/bpf/
Dlibbpf.c187 int *fds; member
264 zclose(prog->instances.fds[i]); in bpf_program__unload()
271 zfree(&prog->instances.fds); in bpf_program__unload()
322 prog->instances.fds = NULL; in bpf_program__init()
1075 if (prog->instances.nr < 0 || !prog->instances.fds) { in bpf_program__load()
1082 prog->instances.fds = malloc(sizeof(int)); in bpf_program__load()
1083 if (!prog->instances.fds) { in bpf_program__load()
1088 prog->instances.fds[0] = -1; in bpf_program__load()
1099 prog->instances.fds[0] = fd; in bpf_program__load()
1119 prog->instances.fds[i] = -1; in bpf_program__load()
[all …]