Home
last modified time | relevance | path

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

12

/linux/tools/testing/selftests/liveupdate/
H A Dliveupdate.c35 int fd1; in FIXTURE() local
41 self->fd1 = -1; in FIXTURE_SETUP()
47 if (self->fd1 >= 0) in FIXTURE_TEARDOWN()
48 close(self->fd1); in FIXTURE_TEARDOWN()
61 self->fd1 = open(LIVEUPDATE_DEV, O_RDWR); in TEST_F()
63 if (self->fd1 < 0 && errno == ENOENT) in TEST_F()
66 ASSERT_GE(self->fd1, 0); in TEST_F()
67 ASSERT_EQ(close(self->fd1), 0); in TEST_F()
68 self->fd1 = -1; in TEST_F()
80 self->fd1 = open(LIVEUPDATE_DEV, O_RDWR); in TEST_F()
[all …]
/linux/tools/testing/selftests/powerpc/ptrace/
H A Dperf-hwbreak.c406 int fd1, fd2; in test_process_multi_diff_addr() local
410 fd1 = perf_process_event_open(HW_BREAKPOINT_RW, (__u64)&a, (__u64)sizeof(a)); in test_process_multi_diff_addr()
411 if (fd1 < 0) { in test_process_multi_diff_addr()
418 close(fd1); in test_process_multi_diff_addr()
423 ioctl(fd1, PERF_EVENT_IOC_RESET); in test_process_multi_diff_addr()
425 ioctl(fd1, PERF_EVENT_IOC_ENABLE); in test_process_multi_diff_addr()
428 ioctl(fd1, PERF_EVENT_IOC_DISABLE); in test_process_multi_diff_addr()
431 res = read(fd1, &breaks1, sizeof(breaks1)); in test_process_multi_diff_addr()
436 close(fd1); in test_process_multi_diff_addr()
451 int fd1, fd2; in test_process_multi_same_addr() local
[all …]
/linux/tools/testing/selftests/bpf/prog_tests/
H 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()
H 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()
141 err = bpf_prog_detach_opts(fd1, cg, atype, &optd); in test_prog_attach_detach()
156 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_link_attach_detach() local
169 fd1 = bpf_program__fd(skel->progs.getsockopt_1); in test_link_attach_detach()
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
292 fd1 = bpf_program__fd(skel->progs.getsockopt_1); in test_preorder_prog_attach_detach()
[all …]
H A Dtc_opts.c18 __u32 fd1, fd2, id1, id2; in serial_test_tc_opts_basic() local
27 fd1 = bpf_program__fd(skel->progs.tc1); in serial_test_tc_opts_basic()
30 id1 = id_from_prog_fd(fd1); in serial_test_tc_opts_basic()
41 err = bpf_prog_attach_opts(fd1, loopback, BPF_TCX_INGRESS, &opta); in serial_test_tc_opts_basic()
101 err = bpf_prog_detach_opts(fd1, loopback, BPF_TCX_INGRESS, &optd); in serial_test_tc_opts_basic()
116 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; in test_tc_opts_before_target() local
125 fd1 = bpf_program__fd(skel->progs.tc1); in test_tc_opts_before_target()
130 id1 = id_from_prog_fd(fd1); in test_tc_opts_before_target()
141 err = bpf_prog_attach_opts(fd1, loopback, target, &opta); in test_tc_opts_before_target()
249 err = bpf_prog_detach_opts(fd1, loopbac 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
2764 __u32 fd1, id1; test_tc_opts_query_attach_target() local
[all...]
H 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()
H 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()
H A Dsockmap_helpers.h72 static inline int add_to_sockmap(int mapfd, int fd1, int fd2) in add_to_sockmap()
76 err = xbpf_map_update_elem(mapfd, &u32(0), &u64(fd1), BPF_NOEXIST); in add_to_sockmap()
69 add_to_sockmap(int sock_mapfd,int fd1,int fd2) add_to_sockmap() argument
/linux/tools/testing/selftests/net/
H 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()
H 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()
H 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()
H 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()
399 if (setsockopt(fd1, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt))) in test_filter_without_bind()
[all …]
H 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()
/linux/tools/testing/selftests/core/
H A Dclose_range_test.c383 int fd1, fd2, fd3, fd4, flags, ret, status; in TEST() local
391 fd1 = open("/dev/null", O_RDWR); in TEST()
392 EXPECT_GT(fd1, 0); in TEST()
394 fd2 = dup2(fd1, 1000); in TEST()
397 flags = fcntl(fd1, F_DUPFD_QUERY, fd2); in TEST()
417 flags = fcntl(fd1, F_GETFD); in TEST()
425 fd3 = dup2(fd1, 42); in TEST()
428 flags = fcntl(fd1, F_DUPFD_QUERY, fd3); in TEST()
456 flags = fcntl(fd1, F_GETFD); in TEST()
464 fd3 = dup2(fd1, 42); in TEST()
[all …]
/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
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()
/linux/tools/perf/tests/
H 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()
/linux/tools/testing/selftests/proc/
H 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()
H A Dproc-pid-vm.c165 int fd, fd1; in make_exe() local
212 fd1 = open(buf, O_RDONLY|O_CLOEXEC); in make_exe()
215 return fd1; in make_exe()
/linux/tools/testing/selftests/kvm/
H A Dguest_memfd_test.c306 int fd1, fd2, ret; in test_create_guest_memfd_multiple() local
309 fd1 = __vm_create_guest_memfd(vm, page_size, 0); in test_create_guest_memfd_multiple()
310 TEST_ASSERT(fd1 != -1, "memfd creation should succeed"); in test_create_guest_memfd_multiple()
312 ret = fstat(fd1, &st1); in test_create_guest_memfd_multiple()
323 ret = fstat(fd1, &st1); in test_create_guest_memfd_multiple()
329 close(fd1); in test_create_guest_memfd_multiple()
/linux/scripts/kconfig/
H A Dconfdata.c49 int fd1, fd2; in is_same() local
54 fd1 = open(file1, O_RDONLY); in is_same()
55 if (fd1 < 0) in is_same()
62 ret = fstat(fd1, &st1); in is_same()
72 map1 = mmap(NULL, st1.st_size, PROT_READ, MAP_PRIVATE, fd1, 0); in is_same()
87 close(fd1); in is_same()
/linux/tools/testing/selftests/sync/
H 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()
H A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
/linux/include/linux/
H A Daudit.h432 extern void __audit_fd_pair(int fd1, int fd2);
455 static inline void audit_fd_pair(int fd1, int fd2) in audit_fd_pair() argument
458 __audit_fd_pair(fd1, fd2); in audit_fd_pair()
671 static inline void audit_fd_pair(int fd1, int fd2) in audit_fd_pair() argument
/linux/tools/testing/selftests/namespaces/
H A Dns_active_ref_test.c40 int fd1, fd2; in TEST() local
47 fd1 = open("/proc/1/ns/net", O_RDONLY); in TEST()
48 ASSERT_GE(fd1, 0); in TEST()
52 ret = name_to_handle_at(fd1, "", handle, &mount_id, AT_EMPTY_PATH); in TEST()
54 SKIP(free(handle); close(fd1); in TEST()
60 close(fd1); in TEST()
71 fd1 = open("/proc/1/ns/net", O_RDONLY); in TEST()
72 ASSERT_GE(fd1, 0); in TEST()
73 ASSERT_EQ(fstat(fd1, &st1), 0); in TEST()
77 close(fd1); in TEST()
/linux/tools/testing/selftests/mm/
H A Dhmm-tests.c96 int fd1; in FIXTURE() local
157 self->fd1 = hmm_open(variant->device_number1); in FIXTURE_SETUP()
158 ASSERT_GE(self->fd1, 0); in FIXTURE_SETUP()
176 ret = close(self->fd1); in FIXTURE_TEARDOWN()
178 self->fd1 = -1; in FIXTURE_TEARDOWN()
1215 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, npages); in TEST_F()
1223 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 3); in TEST_F()
1255 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 4); in TEST_F()
1569 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, 1); in TEST_F()
1725 ret = hmm_dmirror_cmd(self->fd1, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
[all …]

12