Home
last modified time | relevance | path

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

/tools/testing/selftests/powerpc/ptrace/
A Dperf-hwbreak.c418 close(fd1); in test_process_multi_diff_addr()
436 close(fd1); in test_process_multi_diff_addr()
463 close(fd1); in test_process_multi_same_addr()
481 close(fd1); in test_process_multi_same_addr()
508 close(fd1); in test_process_multi_diff_addr_ro_wo()
526 close(fd1); in test_process_multi_diff_addr_ro_wo()
571 close(fd1); in test_process_multi_same_addr_ro_wo()
615 free(fd1); in test_syswide_multi_diff_addr()
659 free(fd1); in test_syswide_multi_same_addr()
703 free(fd1); in test_syswide_multi_diff_addr_ro_wo()
[all …]
/tools/testing/selftests/bpf/prog_tests/
A Dudp_limit.c11 int fd1 = -1, fd2 = -1; in test_udp_limit() local
32 fd1 = socket(AF_INET, SOCK_DGRAM, 0); in test_udp_limit()
33 if (!ASSERT_GE(fd1, 0, "socket(fd1)")) in test_udp_limit()
41 close(fd1); in test_udp_limit()
42 fd1 = -1; in test_udp_limit()
44 fd1 = socket(AF_INET, SOCK_DGRAM, 0); in test_udp_limit()
45 if (!ASSERT_GE(fd1, 0, "socket(fd1-again)")) in test_udp_limit()
63 if (fd1 >= 0) in test_udp_limit()
64 close(fd1); in test_udp_limit()
A Dcgroup_mprog_opts.c23 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_prog_attach_detach() local
36 fd1 = bpf_program__fd(skel->progs.getsockopt_1); in test_prog_attach_detach()
41 id1 = id_from_prog_fd(fd1); in test_prog_attach_detach()
54 err = bpf_prog_attach_opts(fd1, cg, atype, &opta); in test_prog_attach_detach()
156 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_link_attach_detach() local
174 id1 = id_from_prog_fd(fd1); in test_link_attach_detach()
280 __u32 fd1, fd2, fd3, fd4; in test_preorder_prog_attach_detach() local
486 __u32 fd1, fd2, id2; in test_invalid_attach_detach() local
559 .relative_fd = fd1, in test_invalid_attach_detach()
568 .relative_fd = fd1, in test_invalid_attach_detach()
[all …]
A Dxdp_dev_bound_only.c29 int fd1 = -1; in test_xdp_dev_bound_only_offdev() local
42 fd1 = load_dummy_prog("dummy1", ifindex, BPF_F_XDP_DEV_BOUND_ONLY); in test_xdp_dev_bound_only_offdev()
43 if (!ASSERT_GE(fd1, 0, "load_dummy_prog #1")) { in test_xdp_dev_bound_only_offdev()
54 close(fd1); in test_xdp_dev_bound_only_offdev()
A Dtc_opts.c18 __u32 fd1, fd2, id1, id2; in test_ns_tc_opts_basic() local
330 .relative_fd = fd1, in test_tc_opts_after_target()
782 .relative_fd = fd1, in test_tc_opts_replace_target()
826 .relative_fd = fd1, in test_tc_opts_replace_target()
837 .relative_fd = fd1, in test_tc_opts_replace_target()
947 .relative_fd = fd1, in test_tc_opts_invalid_target()
956 .relative_fd = fd1, in test_tc_opts_invalid_target()
979 .relative_fd = fd1, in test_tc_opts_invalid_target()
988 .relative_fd = fd1, in test_tc_opts_invalid_target()
2339 detach_fd = fd1; in test_tc_chain_mixed()
[all …]
A Dxdp_attach.c13 int err, fd1, fd2, fd3; in test_xdp_attach() local
18 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj1, &fd1); in test_xdp_attach()
21 err = bpf_prog_get_info_by_fd(fd1, &info, &len); in test_xdp_attach()
40 err = bpf_xdp_attach(IFINDEX_LO, fd1, XDP_FLAGS_REPLACE, &opts); in test_xdp_attach()
53 opts.old_prog_fd = fd1; 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
76 err = xbpf_map_update_elem(mapfd, &u32(0), &u64(fd1), BPF_NOEXIST); in add_to_sockmap()
A Dtc_netkit.c435 __u32 pid1, pid2, fd1, fd2; in serial_test_tc_netkit_multi_opts_target() local
450 fd1 = bpf_program__fd(skel->progs.tc1); in serial_test_tc_netkit_multi_opts_target()
453 pid1 = id_from_prog_fd(fd1); in serial_test_tc_netkit_multi_opts_target()
464 err = bpf_prog_attach_opts(fd1, ifindex, target, &opta); in serial_test_tc_netkit_multi_opts_target()
493 .relative_fd = fd1, in serial_test_tc_netkit_multi_opts_target()
527 err = bpf_prog_detach_opts(fd1, ifindex, target, &optd); in serial_test_tc_netkit_multi_opts_target()
/tools/testing/selftests/net/
A Dsk_connect_zero_addr.c10 int fd1, fd2, one = 1; in main() local
21 fd1 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP); in main()
22 if (fd1 < 0) { in main()
27 if (setsockopt(fd1, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) { in main()
32 if (bind(fd1, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) { in main()
37 if (listen(fd1, 0)) { in main()
54 close(fd1); in main()
60 close(fd1); in main()
A Dsk_bind_sendto_listen.c10 int fd1, fd2, one = 1; in main() local
21 fd1 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP); in main()
22 if (fd1 < 0) { in main()
27 if (setsockopt(fd1, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) { in main()
32 if (bind(fd1, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) { in main()
37 if (sendto(fd1, NULL, 0, MSG_FASTOPEN, (struct sockaddr *)&bind_addr, in main()
71 close(fd1); in main()
78 close(fd1); in main()
A Dreuseaddr_conflict.c89 int fd1, fd2; in main() local
96 fd1 = open_port(0, 1); in main()
97 if (fd1 >= 0) in main()
100 fd1 = open_port(1, 1); in main()
101 if (fd1 < 0) in main()
107 close(fd1); in main()
109 fd1 = open_port(0, 1); in main()
110 if (fd1 >= 0) in main()
A Dreuseport_bpf.c309 int fd1, fd2, opt; in test_extra_filter() local
312 fd1 = socket(p.recv_family, p.protocol, 0); in test_extra_filter()
313 if (fd1 < 0) in test_extra_filter()
320 if (setsockopt(fd1, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt))) in test_extra_filter()
325 attach_ebpf(fd1, 10); in test_extra_filter()
328 if (bind(fd1, addr, sockaddr_size())) in test_extra_filter()
390 int fd1, fd2, opt = 1; in test_filter_without_bind() local
393 fd1 = socket(AF_INET, SOCK_DGRAM, 0); in test_filter_without_bind()
394 if (fd1 < 0) in test_filter_without_bind()
404 attach_ebpf(fd1, 10); in test_filter_without_bind()
[all …]
A Dpsock_fanout.c287 int val, fd0, fd1, err; in test_unbound_fanout() local
302 fd1 = sock_fanout_open(PACKET_FANOUT_HASH, 1); in test_unbound_fanout()
303 if (fd1 == -1) { in test_unbound_fanout()
314 close(fd1); in test_unbound_fanout()
/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
42 fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644); in main()
45 if (fd1 < 0) { in main()
105 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2), in main()
117 ret = sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd1); in main()
/tools/testing/selftests/proc/
A Dfd-002-posix-eq.c27 int fd0, fd1, fd2; in main() local
36 fd1 = open(buf, O_RDONLY); in main()
37 assert(fd1 >= 0); in main()
45 rv = fstat(fd1, &st1); in main()
A Dproc-pid-vm.c161 int fd, fd1; in make_exe() local
208 fd1 = open(buf, O_RDONLY|O_CLOEXEC); in make_exe()
211 return fd1; in make_exe()
/tools/perf/tests/
A Dbp_signal.c33 static int fd1; variable
76 ioctl(fd1, PERF_EVENT_IOC_DISABLE, 0); in sig_handler_2()
97 ioctl(fd1, PERF_EVENT_IOC_DISABLE, 0); in sig_handler()
242 fd1 = bp_event(__test_function, SIGIO); in test__bp_signal()
246 ioctl(fd1, PERF_EVENT_IOC_ENABLE, 0); in test__bp_signal()
256 ioctl(fd1, PERF_EVENT_IOC_DISABLE, 0); in test__bp_signal()
260 count1 = bp_count(fd1); in test__bp_signal()
264 close(fd1); in test__bp_signal()
/tools/testing/selftests/core/
A Dclose_range_test.c392 EXPECT_GT(fd1, 0); in TEST()
394 fd2 = dup2(fd1, 1000); in TEST()
425 fd3 = dup2(fd1, 42); in TEST()
464 fd3 = dup2(fd1, 42); in TEST()
489 EXPECT_EQ(close(fd1), 0); in TEST()
519 EXPECT_GT(fd1, 0); in TEST()
521 fd2 = dup2(fd1, 1000); in TEST()
548 fd3 = dup2(fd1, 42); in TEST()
559 EXPECT_EQ(close(fd1), 0); in TEST()
584 fd3 = dup2(fd1, 42); in TEST()
[all …]
/tools/testing/selftests/kvm/
A Dguest_memfd_test.c147 int fd1, fd2, ret; in test_create_guest_memfd_multiple() local
150 fd1 = __vm_create_guest_memfd(vm, 4096, 0); in test_create_guest_memfd_multiple()
151 TEST_ASSERT(fd1 != -1, "memfd creation should succeed"); in test_create_guest_memfd_multiple()
153 ret = fstat(fd1, &st1); in test_create_guest_memfd_multiple()
164 ret = fstat(fd1, &st1); in test_create_guest_memfd_multiple()
170 close(fd1); in test_create_guest_memfd_multiple()
/tools/testing/selftests/sync/
A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
A Dsync.c68 int sync_merge(const char *name, int fd1, int fd2) in sync_merge() argument
77 err = ioctl(fd1, SYNC_IOC_MERGE, &data); in sync_merge()
/tools/testing/selftests/mm/
A Dhmm-tests.c93 int fd1; in FIXTURE() local
154 self->fd1 = hmm_open(variant->device_number1); in FIXTURE_SETUP()
155 ASSERT_GE(self->fd1, 0); in FIXTURE_SETUP()
173 ret = close(self->fd1); in FIXTURE_TEARDOWN()
175 self->fd1 = -1; in FIXTURE_TEARDOWN()
1179 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, npages); in TEST_F()
1187 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 3); in TEST_F()
1219 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 4); in TEST_F()
1533 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 1); in TEST_F()
1689 ret = hmm_dmirror_cmd(self->fd1, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
[all …]
/tools/power/x86/intel-speed-select/
A Disst-config.c1037 int fd, fd1, len, ret; in cpu_0_workaround() local
1066 fd1 = open("/sys/fs/cgroup/0-0-0/cpuset.cpus.partition", O_RDONLY, 0); in cpu_0_workaround()
1068 if (fd1 < 0) { in cpu_0_workaround()
1074 len = read(fd1, str, sizeof(str)); in cpu_0_workaround()
1076 close(fd1); in cpu_0_workaround()
1081 close(fd1); in cpu_0_workaround()
/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 905 milliseconds