Home
last modified time | relevance | path

Searched refs:fd2 (Results 1 – 24 of 24) sorted by relevance

/tools/testing/selftests/powerpc/ptrace/
A Dperf-hwbreak.c406 int fd1, fd2; in test_process_multi_diff_addr() local
437 close(fd2); in test_process_multi_diff_addr()
451 int fd1, fd2; in test_process_multi_same_addr() local
482 close(fd2); in test_process_multi_same_addr()
496 int fd1, fd2; in test_process_multi_diff_addr_ro_wo() local
527 close(fd2); in test_process_multi_diff_addr_ro_wo()
572 close(fd2); in test_process_multi_same_addr_ro_wo()
616 free(fd2); in test_syswide_multi_diff_addr()
660 free(fd2); in test_syswide_multi_same_addr()
704 free(fd2); in test_syswide_multi_diff_addr_ro_wo()
[all …]
/tools/testing/selftests/net/
A Dsk_bind_sendto_listen.c10 int fd1, fd2, one = 1; in main() local
43 fd2 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP); in main()
44 if (fd2 < 0) { in main()
49 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) { in main()
54 if (bind(fd2, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) { in main()
59 if (sendto(fd2, NULL, 0, MSG_FASTOPEN, (struct sockaddr *)&bind_addr, in main()
65 if (listen(fd2, 0)) { in main()
70 close(fd2); in main()
75 close(fd2); in main()
A Dsk_connect_zero_addr.c10 int fd1, fd2, one = 1; in main() local
42 fd2 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP); in main()
43 if (fd2 < 0) { in main()
48 if (connect(fd2, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) { in main()
53 close(fd2); in main()
58 close(fd2); in main()
A Dtun.c108 int fd, fd2; in FIXTURE() local
118 self->fd2 = tun_alloc(self->ifname); in FIXTURE_SETUP()
119 ASSERT_GE(self->fd2, 0); in FIXTURE_SETUP()
126 if (self->fd2 >= 0) in FIXTURE_TEARDOWN()
127 close(self->fd2); in FIXTURE_TEARDOWN()
A Dreuseaddr_conflict.c89 int fd1, fd2; in main() local
104 fd2 = open_port(0, 1); in main()
105 if (fd2 >= 0) in main()
A Dreuseport_bpf.c309 int fd1, fd2, opt; in test_extra_filter() local
315 fd2 = socket(p.recv_family, p.protocol, 0); in test_extra_filter()
316 if (fd2 < 0) in test_extra_filter()
322 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt))) in test_extra_filter()
326 attach_ebpf(fd2, 10); in test_extra_filter()
331 if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE) in test_extra_filter()
390 int fd1, fd2, opt = 1; in test_filter_without_bind() local
396 fd2 = socket(AF_INET, SOCK_DGRAM, 0); in test_filter_without_bind()
397 if (fd2 < 0) in test_filter_without_bind()
405 attach_cbpf(fd2, 10); in test_filter_without_bind()
[all …]
A Dtls.c2170 int fd2, cfd2; in FIXTURE() local
2213 close(self->fd2); in FIXTURE_TEARDOWN()
2225 EXPECT_EQ(send(self->fd2, buf, sizeof(buf), 0), sizeof(buf)); in TEST_F()
2247 EXPECT_EQ(send(self->fd2, buf, n, 0), n); in TEST_F()
2274 EXPECT_EQ(send(self->fd2, cip[i], n, 0), n); in TEST_F()
2305 EXPECT_EQ(send(self->fd2, cip, n, 0), n); in TEST_F()
2311 EXPECT_EQ(send(self->fd2, cip, n, 0), n); in TEST_F()
2373 EXPECT_EQ(send(self->fd2, rec, 100, 0), 100); in TEST_F()
2414 EXPECT_EQ(send(self->fd2, rec, 100, 0), 100); in TEST_F()
2455 EXPECT_EQ(send(self->fd2, rec, 100, 0), 100); in TEST_F()
[all …]
/tools/testing/selftests/bpf/prog_tests/
A Dudp_limit.c11 int fd1 = -1, fd2 = -1; in test_udp_limit() local
36 fd2 = socket(AF_INET, SOCK_DGRAM, 0); in test_udp_limit()
37 if (!ASSERT_LT(fd2, 0, "socket(fd2)")) in test_udp_limit()
65 if (fd2 >= 0) in test_udp_limit()
66 close(fd2); in test_udp_limit()
A Dxdp_dev_bound_only.c30 int fd2 = -1; in test_xdp_dev_bound_only_offdev() local
50 fd2 = load_dummy_prog("dummy2", ifindex, 0); in test_xdp_dev_bound_only_offdev()
51 ASSERT_EQ(fd2, -EINVAL, "load_dummy_prog #2 (offloaded)"); in test_xdp_dev_bound_only_offdev()
55 close(fd2); in test_xdp_dev_bound_only_offdev()
A Dcgroup_mprog_opts.c23 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_prog_attach_detach() local
42 id2 = id_from_prog_fd(fd2); in test_prog_attach_detach()
74 .relative_fd = fd2, in test_prog_attach_detach()
175 id2 = id_from_prog_fd(fd2); in test_link_attach_detach()
280 __u32 fd1, fd2, fd3, fd4; in test_preorder_prog_attach_detach() local
325 .relative_fd = fd2, in test_preorder_prog_attach_detach()
337 .relative_fd = fd2, in test_preorder_prog_attach_detach()
389 __u32 fd2; in test_preorder_link_attach_detach() local
429 .relative_fd = fd2, in test_preorder_link_attach_detach()
486 __u32 fd1, fd2, id2; in test_invalid_attach_detach() local
[all …]
A Dtc_opts.c18 __u32 fd1, fd2, id1, id2; in test_ns_tc_opts_basic() local
31 id2 = id_from_prog_fd(fd2); in test_ns_tc_opts_basic()
178 .relative_fd = fd2, in test_tc_opts_before_target()
713 detach_fd = fd2; in test_tc_opts_replace_target()
747 .replace_prog_fd = fd2, in test_tc_opts_replace_target()
790 detach_fd = fd2; in test_tc_opts_replace_target()
920 .relative_fd = fd2, in test_tc_opts_invalid_target()
929 .relative_fd = fd2, in test_tc_opts_invalid_target()
1895 .relative_fd = fd2, in test_tc_opts_detach_before_target()
1919 .relative_fd = fd2, in test_tc_opts_detach_before_target()
[all …]
A Dxdp_attach.c13 int err, fd1, fd2, fd3; in test_xdp_attach() local
26 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj2, &fd2); in test_xdp_attach()
31 err = bpf_prog_get_info_by_fd(fd2, &info, &len); in test_xdp_attach()
49 err = bpf_xdp_attach(IFINDEX_LO, fd2, XDP_FLAGS_REPLACE, &opts); in test_xdp_attach()
54 err = bpf_xdp_attach(IFINDEX_LO, fd2, 0, &opts); in test_xdp_attach()
70 opts.old_prog_fd = fd2; in test_xdp_attach()
A Dsockmap_helpers.h72 static inline int add_to_sockmap(int mapfd, int fd1, int fd2) in add_to_sockmap() argument
80 return xbpf_map_update_elem(mapfd, &u32(1), &u64(fd2), BPF_NOEXIST); in add_to_sockmap()
A Dtc_netkit.c435 __u32 pid1, pid2, fd1, fd2; in serial_test_tc_netkit_multi_opts_target() local
451 fd2 = bpf_program__fd(skel->progs.tc2); in serial_test_tc_netkit_multi_opts_target()
454 pid2 = id_from_prog_fd(fd2); in serial_test_tc_netkit_multi_opts_target()
496 err = bpf_prog_attach_opts(fd2, ifindex, target, &opta); in serial_test_tc_netkit_multi_opts_target()
523 err = bpf_prog_detach_opts(fd2, ifindex, target, &optd); in serial_test_tc_netkit_multi_opts_target()
/tools/testing/selftests/proc/
A Dfd-002-posix-eq.c27 int fd0, fd1, fd2; in main() local
40 fd2 = open(buf, O_RDONLY); in main()
41 assert(fd2 >= 0); in main()
47 rv = fstat(fd2, &st2); in main()
/tools/testing/selftests/filelock/
A Dofdlocks.c40 int fd2 = open("/tmp/aa", O_RDONLY); in main() local
44 assert(fd2 != -1); in main()
45 ksft_print_msg("[INFO] opened fds %i %i\n", fd, fd2); in main()
63 rc = lock_get(fd2, &fl); in main()
74 rc = lock_get(fd2, &fl); in main()
125 lock_get(fd2, &fl); in main()
/tools/perf/tests/
A Dbp_signal.c34 static int fd2; variable
77 ioctl(fd2, PERF_EVENT_IOC_DISABLE, 0); in sig_handler_2()
98 ioctl(fd2, PERF_EVENT_IOC_DISABLE, 0); in sig_handler()
243 fd2 = bp_event(sig_handler, SIGUSR1); in test__bp_signal()
247 ioctl(fd2, PERF_EVENT_IOC_ENABLE, 0); in test__bp_signal()
257 ioctl(fd2, PERF_EVENT_IOC_DISABLE, 0); in test__bp_signal()
261 count2 = bp_count(fd2); in test__bp_signal()
265 close(fd2); in test__bp_signal()
/tools/testing/selftests/kcmp/
A Dkcmp_test.c23 static long sys_kcmp(int pid1, int pid2, int type, unsigned long fd1, unsigned long fd2) in sys_kcmp() argument
25 return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2); in sys_kcmp()
37 int fd1, fd2; in main() local
94 fd2 = open(kpath, O_RDWR); in main()
95 if (fd2 < 0) { in main()
105 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2), in main()
/tools/testing/selftests/memfd/
A Dmemfd_test.c588 int r, fd2; in mfd_assert_shrink() local
601 close(fd2); in mfd_assert_shrink()
967 int fd, fd2; in test_seal_future_write() local
990 mfd_assert_read(fd2); in test_seal_future_write()
992 mfd_fail_write(fd2); in test_seal_future_write()
997 close(fd2); in test_seal_future_write()
1460 int fd, fd2; in test_share_dup() local
1489 close(fd2); in test_share_dup()
1536 int fd, fd2; in test_share_open() local
1561 close(fd2); in test_share_open()
[all …]
/tools/testing/selftests/core/
A Dclose_range_test.c394 fd2 = dup2(fd1, 1000); in TEST()
395 EXPECT_GT(fd2, 0); in TEST()
421 flags = fcntl(fd2, F_GETFD); in TEST()
460 flags = fcntl(fd2, F_GETFD); in TEST()
490 EXPECT_EQ(close(fd2), 0); in TEST()
521 fd2 = dup2(fd1, 1000); in TEST()
522 EXPECT_GT(fd2, 0); in TEST()
544 flags = fcntl(fd2, F_GETFD); in TEST()
560 EXPECT_EQ(close(fd2), 0); in TEST()
580 flags = fcntl(fd2, F_GETFD); in TEST()
[all …]
/tools/testing/selftests/kvm/
A Dguest_memfd_test.c147 int fd1, fd2, ret; in test_create_guest_memfd_multiple() local
157 fd2 = __vm_create_guest_memfd(vm, 8192, 0); in test_create_guest_memfd_multiple()
158 TEST_ASSERT(fd2 != -1, "memfd creation should succeed"); in test_create_guest_memfd_multiple()
160 ret = fstat(fd2, &st2); in test_create_guest_memfd_multiple()
169 close(fd2); in test_create_guest_memfd_multiple()
/tools/testing/selftests/sync/
A Dsync.c68 int sync_merge(const char *name, int fd1, int fd2) in sync_merge() argument
73 data.fd2 = fd2; in sync_merge()
A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
/tools/testing/selftests/seccomp/
A Dseccomp_bpf.c315 static int __filecmp(pid_t pid1, pid_t pid2, int fd1, int fd2) in __filecmp() argument
319 return syscall(__NR_kcmp, pid1, pid2, KCMP_FILE, fd1, fd2); in __filecmp()
327 #define filecmp(pid1, pid2, fd1, fd2) ({ \ argument
330 _ret = __filecmp(pid1, pid2, fd1, fd2); \

Completed in 43 milliseconds