Home
last modified time | relevance | path

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

12

/linux/tools/testing/selftests/powerpc/ptrace/
H A Dperf-hwbreak.c406 int fd1, fd2; in test_process_multi_diff_addr() local
416 fd2 = perf_process_event_open(HW_BREAKPOINT_RW, (__u64)&b, (__u64)sizeof(b)); in test_process_multi_diff_addr()
417 if (fd2 < 0) { in test_process_multi_diff_addr()
424 ioctl(fd2, PERF_EVENT_IOC_RESET); in test_process_multi_diff_addr()
426 ioctl(fd2, PERF_EVENT_IOC_ENABLE); in test_process_multi_diff_addr()
429 ioctl(fd2, PERF_EVENT_IOC_DISABLE); in test_process_multi_diff_addr()
433 res = read(fd2, &breaks2, sizeof(breaks2)); in test_process_multi_diff_addr()
437 close(fd2); in test_process_multi_diff_addr()
451 int fd1, fd2; in test_process_multi_same_addr() local
461 fd2 = perf_process_event_open(HW_BREAKPOINT_RW, (__u64)&a, (__u64)sizeof(a)); in test_process_multi_same_addr()
[all …]
/linux/tools/testing/selftests/net/
H 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()
H 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()
H 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()
H 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()
401 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt))) in test_filter_without_bind()
[all …]
H A Dreuseaddr_conflict.c89 int fd1, fd2; in main() local
104 fd2 = open_port(0, 1); in main()
105 if (fd2 >= 0) in main()
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dcgroup_mprog_opts.c23 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_prog_attach_detach() local
37 fd2 = bpf_program__fd(skel->progs.getsockopt_2); in test_prog_attach_detach()
42 id2 = id_from_prog_fd(fd2); in test_prog_attach_detach()
66 err = bpf_prog_attach_opts(fd2, cg, atype, &opta); in test_prog_attach_detach()
74 .relative_fd = fd2, in test_prog_attach_detach()
136 err = bpf_prog_detach_opts(fd2, cg, atype, &optd); in test_prog_attach_detach()
156 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_link_attach_detach() local
170 fd2 = bpf_program__fd(skel->progs.getsockopt_2); in test_link_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
[all …]
H A Dtc_opts.c18 __u32 fd1, fd2, id1, id2; in serial_test_tc_opts_basic() local
28 fd2 = bpf_program__fd(skel->progs.tc2); in serial_test_tc_opts_basic()
31 id2 = id_from_prog_fd(fd2); in serial_test_tc_opts_basic()
68 err = bpf_prog_attach_opts(fd2, loopback, BPF_TCX_EGRESS, &opta); in serial_test_tc_opts_basic()
94 err = bpf_prog_detach_opts(fd2, loopback, BPF_TCX_EGRESS, &optd); in serial_test_tc_opts_basic()
116 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_before_target() local
126 fd2 = bpf_program__fd(skel->progs.tc2); in test_tc_opts_before_target()
131 id2 = id_from_prog_fd(fd2); in test_tc_opts_before_target()
147 err = bpf_prog_attach_opts(fd2, loopback, target, &opta); in test_tc_opts_before_target()
178 .relative_fd = fd2, in test_tc_opts_before_target()
268 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_after_target() local
459 __u32 fd1, fd2, id1, id2; test_tc_opts_revision_target() local
570 __u32 fd1, fd2, fd3, id1, id2, id3; test_tc_chain_classic() local
671 __u32 fd1, fd2, fd3, id1, id2, id3, detach_fd; test_tc_opts_replace_target() local
877 __u32 fd1, fd2, id1, id2; test_tc_opts_invalid_target() local
1031 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_prepend_target() local
1171 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_append_target() local
1311 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_dev_cleanup_target() local
1656 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_detach_target() local
1827 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_detach_before_target() local
2034 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_detach_after_target() local
2282 __u32 fd1, fd2, fd3, id1, id2, id3; test_tc_chain_mixed() local
2467 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; test_tc_opts_query_target() local
[all...]
H 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()
H 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()
H 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()
H A Dsockmap_helpers.h72 static inline int add_to_sockmap(int mapfd, int fd1, int fd2) in add_to_sockmap()
80 return xbpf_map_update_elem(mapfd, &u32(1), &u64(fd2), BPF_NOEXIST); in add_to_sockmap()
69 add_to_sockmap(int sock_mapfd,int fd1,int fd2) add_to_sockmap() argument
/linux/tools/perf/tests/
H 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()
/linux/tools/testing/selftests/memfd/
H A Dmemfd_test.c588 int r, fd2; in mfd_assert_shrink() local
598 fd2 = mfd_assert_open(fd, in mfd_assert_shrink()
601 close(fd2); in mfd_assert_shrink()
967 int fd, fd2; in test_seal_future_write() local
988 fd2 = mfd_assert_reopen_fd(fd); in test_seal_future_write()
990 mfd_assert_read(fd2); in test_seal_future_write()
991 mfd_assert_read_shared(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
[all …]
/linux/tools/testing/selftests/filelock/
H 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()
/linux/tools/testing/selftests/kcmp/
H 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()
/linux/tools/testing/selftests/proc/
H 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()
/linux/tools/testing/selftests/core/
H A Dclose_range_test.c383 int fd1, fd2, fd3, fd4, flags, ret, status; in TEST() local
394 fd2 = dup2(fd1, 1000); in TEST()
395 EXPECT_GT(fd2, 0); in TEST()
397 flags = fcntl(fd1, F_DUPFD_QUERY, fd2); 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()
500 int i, fd1, fd2, fd3, flags, ret, status; in TEST() local
521 fd2 = dup2(fd1, 1000); in TEST()
522 EXPECT_GT(fd2, 0); in TEST()
[all …]
/linux/tools/testing/selftests/liveupdate/
H A Dliveupdate.c36 int fd2; in FIXTURE() local
42 self->fd2 = -1; in FIXTURE_SETUP()
49 if (self->fd2 >= 0) in FIXTURE_TEARDOWN()
50 close(self->fd2); in FIXTURE_TEARDOWN()
86 self->fd2 = open(LIVEUPDATE_DEV, O_RDWR); in TEST_F()
87 EXPECT_LT(self->fd2, 0); in TEST_F()
/linux/tools/testing/selftests/sync/
H A Dsync.c68 int sync_merge(const char *name, int fd1, int fd2) in sync_merge() argument
73 data.fd2 = fd2; in sync_merge()
H A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
/linux/tools/testing/selftests/kvm/
H A Dguest_memfd_test.c306 int fd1, fd2, ret; in test_create_guest_memfd_multiple() local
316 fd2 = __vm_create_guest_memfd(vm, page_size * 2, 0); in test_create_guest_memfd_multiple()
317 TEST_ASSERT(fd2 != -1, "memfd creation should succeed"); in test_create_guest_memfd_multiple()
319 ret = fstat(fd2, &st2); in test_create_guest_memfd_multiple()
328 close(fd2); in test_create_guest_memfd_multiple()
/linux/scripts/kconfig/
H A Dconfdata.c49 int fd1, fd2; in is_same() local
58 fd2 = open(file2, O_RDONLY); in is_same()
59 if (fd2 < 0) in is_same()
65 ret = fstat(fd2, &st2); in is_same()
76 map2 = mmap(NULL, st2.st_size, PROT_READ, MAP_PRIVATE, fd2, 0); in is_same()
85 close(fd2); in is_same()
/linux/include/uapi/linux/
H A Dsync_file.h32 __s32 fd2; member
/linux/tools/testing/selftests/namespaces/
H A Dns_active_ref_test.c40 int fd1, fd2; in TEST() local
63 fd2 = open_by_handle_at(FD_NSFS_ROOT, handle, O_RDONLY); in TEST()
64 if (fd2 < 0 && (errno == EINVAL || errno == EOPNOTSUPP)) { in TEST()
68 ASSERT_GE(fd2, 0); in TEST()
74 ASSERT_EQ(fstat(fd2, &st2), 0); in TEST()
78 close(fd2); in TEST()
588 int fd2 = open_by_handle_at(FD_NSFS_ROOT, handle, O_RDONLY); in TEST() local
589 ASSERT_GE(fd2, 0); in TEST()
591 TH_LOG("Successfully reopened namespace via file handle, got fd %d", fd2); in TEST()
596 ASSERT_EQ(fstat(fd2, &st2), 0); in TEST()
[all …]

12