/linux/tools/testing/selftests/powerpc/ptrace/ |
H A D | perf-hwbreak.c | 406 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 D | udp_limit.c | 11 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 D | tc_opts.c | 18 __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, loopback, target, &optd); in test_tc_opts_before_target() [all …]
|
H A D | xdp_dev_bound_only.c | 29 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 D | xdp_attach.c | 13 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 D | sockmap_helpers.h | 69 static inline int add_to_sockmap(int sock_mapfd, int fd1, int fd2) in add_to_sockmap() argument 76 value = fd1; in add_to_sockmap()
|
/linux/tools/testing/selftests/net/ |
H A D | sk_connect_zero_addr.c | 10 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 D | sk_bind_sendto_listen.c | 10 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 D | reuseaddr_conflict.c | 89 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 D | reuseport_bpf.c | 309 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 D | psock_fanout.c | 287 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 D | close_range_test.c | 383 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 D | kcmp_test.c | 23 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 D | bp_signal.c | 33 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 D | fd-002-posix-eq.c | 27 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 D | proc-pid-vm.c | 161 int fd, fd1; in make_exe() local 208 fd1 = open(buf, O_RDONLY|O_CLOEXEC); in make_exe() 211 return fd1; in make_exe()
|
/linux/tools/testing/selftests/kvm/ |
H A D | guest_memfd_test.c | 147 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()
|
/linux/tools/testing/selftests/sync/ |
H A D | sync.c | 68 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 D | sync.h | 36 int sync_merge(const char *name, int fd1, int fd2);
|
/linux/include/linux/ |
H A D | audit.h | 409 extern void __audit_fd_pair(int fd1, int fd2); 432 static inline void audit_fd_pair(int fd1, int fd2) in audit_fd_pair() argument 435 __audit_fd_pair(fd1, fd2); in audit_fd_pair() 648 static inline void audit_fd_pair(int fd1, int fd2) in audit_fd_pair() argument
|
/linux/tools/testing/selftests/mm/ |
H A D | hmm-tests.c | 93 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 …]
|
/linux/net/ |
H A D | socket.c | 1714 int fd1, fd2, err; in __sys_socketpair() local 1730 fd1 = get_unused_fd_flags(flags); in __sys_socketpair() 1731 if (unlikely(fd1 < 0)) in __sys_socketpair() 1732 return fd1; in __sys_socketpair() 1736 put_unused_fd(fd1); in __sys_socketpair() 1740 err = put_user(fd1, &usockvec[0]); in __sys_socketpair() 1791 audit_fd_pair(fd1, fd2); in __sys_socketpair() 1793 fd_install(fd1, newfile1); in __sys_socketpair() 1799 put_unused_fd(fd1); in __sys_socketpair()
|
/linux/drivers/net/wireless/ath/carl9170/ |
H A D | phy.c | 970 u32 d0, d1, td0, td1, fd0, fd1; in carl9170_init_rf_bank4_pwr() local 1019 fd1 = td1 << 5 | td0; in carl9170_init_rf_bank4_pwr() 1024 carl9170_regwrite(0x1c58e8, fd1); in carl9170_init_rf_bank4_pwr()
|
/linux/tools/power/x86/intel-speed-select/ |
H A D | isst-config.c | 1019 int fd, fd1, len, ret; in cpu_0_workaround() local 1048 fd1 = open("/sys/fs/cgroup/0-0-0/cpuset.cpus.partition", O_RDONLY, 0); in cpu_0_workaround() 1050 if (fd1 < 0) { in cpu_0_workaround() 1056 len = read(fd1, str, sizeof(str)); in cpu_0_workaround() 1058 close(fd1); in cpu_0_workaround() 1063 close(fd1); in cpu_0_workaround()
|
/linux/drivers/net/ |
H A D | gtp.c | 1715 int fd1 = nla_get_u32(data[IFLA_GTP_FD1]); in gtp_encap_enable() local 1717 if (fd1 >= 0) { in gtp_encap_enable() 1718 sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp); in gtp_encap_enable()
|