Searched refs:fd2 (Results 1 - 25 of 29) sorted by relevance

12

/linux-master/tools/testing/selftests/net/
H A Dsk_bind_sendto_listen.c10 int fd1, fd2, one = 1; local
43 fd2 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP);
44 if (fd2 < 0) {
45 error(1, errno, "socket fd2");
49 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) {
50 error(1, errno, "setsockopt(SO_REUSEADDR) fd2");
54 if (bind(fd2, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) {
55 error(1, errno, "bind fd2");
59 if (sendto(fd2, NULL, 0, MSG_FASTOPEN, (struct sockaddr *)&bind_addr,
61 error(1, errno, "sendto fd2");
[all...]
H A Dsk_connect_zero_addr.c10 int fd1, fd2, one = 1; local
42 fd2 = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP);
43 if (fd2 < 0) {
44 error(1, errno, "socket fd2");
48 if (connect(fd2, (struct sockaddr *)&bind_addr, sizeof(bind_addr))) {
49 error(1, errno, "bind fd2");
53 close(fd2);
58 close(fd2);
H A Dreuseaddr_conflict.c89 int fd1, fd2; local
104 fd2 = open_port(0, 1);
105 if (fd2 >= 0)
H A Dtun.c108 int fd, fd2; local
118 self->fd2 = tun_alloc(self->ifname);
119 ASSERT_GE(self->fd2, 0);
126 if (self->fd2 >= 0)
127 close(self->fd2);
H A Dreuseport_bpf.c309 int fd1, fd2, opt; local
315 fd2 = socket(p.recv_family, p.protocol, 0);
316 if (fd2 < 0)
322 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)))
326 attach_ebpf(fd2, 10);
331 if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE)
390 int fd1, fd2, opt = 1; local
396 fd2 = socket(AF_INET, SOCK_DGRAM, 0);
397 if (fd2 < 0)
401 if (setsockopt(fd2, SOL_SOCKE
[all...]
H A Dtls.c1655 int fd2, cfd2; local
1683 ulp_sock_pair(_metadata, &self->fd2, &self->cfd2, &self->notls);
1698 close(self->fd2);
1710 EXPECT_EQ(send(self->fd2, buf, sizeof(buf), 0), sizeof(buf));
1732 EXPECT_EQ(send(self->fd2, buf, n, 0), n);
1759 EXPECT_EQ(send(self->fd2, cip[i], n, 0), n);
1790 EXPECT_EQ(send(self->fd2, cip, n, 0), n);
1796 EXPECT_EQ(send(self->fd2, cip, n, 0), n);
1858 EXPECT_EQ(send(self->fd2, rec, 100, 0), 100);
1864 EXPECT_EQ(send(self->fd2, re
[all...]
/linux-master/tools/testing/selftests/sync/
H A Dsync.h36 int sync_merge(const char *name, int fd1, int fd2);
H A Dsync.c68 int sync_merge(const char *name, int fd1, int fd2) argument
73 data.fd2 = fd2;
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dudp_limit.c11 int fd1 = -1, fd2 = -1; local
36 fd2 = socket(AF_INET, SOCK_DGRAM, 0);
37 if (!ASSERT_LT(fd2, 0, "socket(fd2)"))
65 if (fd2 >= 0)
66 close(fd2);
H A Dxdp_dev_bound_only.c30 int fd2 = -1; local
50 fd2 = load_dummy_prog("dummy2", ifindex, 0);
51 ASSERT_EQ(fd2, -EINVAL, "load_dummy_prog #2 (offloaded)");
55 close(fd2);
H A Dxdp_attach.c13 int err, fd1, fd2, fd3; local
26 err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj2, &fd2);
31 err = bpf_prog_get_info_by_fd(fd2, &info, &len);
49 err = bpf_xdp_attach(IFINDEX_LO, fd2, XDP_FLAGS_REPLACE, &opts);
54 err = bpf_xdp_attach(IFINDEX_LO, fd2, 0, &opts);
70 opts.old_prog_fd = fd2;
H A Dtc_opts.c18 __u32 fd1, fd2, id1, id2; local
28 fd2 = bpf_program__fd(skel->progs.tc2);
31 id2 = id_from_prog_fd(fd2);
68 err = bpf_prog_attach_opts(fd2, loopback, BPF_TCX_EGRESS, &opta);
94 err = bpf_prog_detach_opts(fd2, loopback, BPF_TCX_EGRESS, &optd);
116 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
126 fd2 = bpf_program__fd(skel->progs.tc2);
131 id2 = id_from_prog_fd(fd2);
147 err = bpf_prog_attach_opts(fd2, loopback, target, &opta);
178 .relative_fd = fd2,
268 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
459 __u32 fd1, fd2, id1, id2; local
570 __u32 fd1, fd2, fd3, id1, id2, id3; local
671 __u32 fd1, fd2, fd3, id1, id2, id3, detach_fd; local
877 __u32 fd1, fd2, id1, id2; local
1031 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
1171 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
1311 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
1656 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
1827 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
2034 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
2282 __u32 fd1, fd2, fd3, id1, id2, id3; local
2467 __u32 fd1, fd2, fd3, fd4, id1, id2, id3, id4; local
[all...]
H A Dsockmap_helpers.h298 static inline int add_to_sockmap(int sock_mapfd, int fd1, int fd2) argument
311 value = fd2;
H A Dtc_netkit.c390 __u32 pid1, pid2, fd1, fd2; local
405 fd2 = bpf_program__fd(skel->progs.tc2);
408 pid2 = id_from_prog_fd(fd2);
450 err = bpf_prog_attach_opts(fd2, ifindex, target, &opta);
477 err = bpf_prog_detach_opts(fd2, ifindex, target, &optd);
/linux-master/tools/testing/selftests/proc/
H A Dfd-002-posix-eq.c27 int fd0, fd1, fd2; local
40 fd2 = open(buf, O_RDONLY);
41 assert(fd2 >= 0);
47 rv = fstat(fd2, &st2);
/linux-master/tools/testing/selftests/powerpc/ptrace/
H A Dperf-hwbreak.c406 int fd1, fd2; local
416 fd2 = perf_process_event_open(HW_BREAKPOINT_RW, (__u64)&b, (__u64)sizeof(b));
417 if (fd2 < 0) {
424 ioctl(fd2, PERF_EVENT_IOC_RESET);
426 ioctl(fd2, PERF_EVENT_IOC_ENABLE);
429 ioctl(fd2, PERF_EVENT_IOC_DISABLE);
433 res = read(fd2, &breaks2, sizeof(breaks2));
437 close(fd2);
451 int fd1, fd2; local
461 fd2
496 int fd1, fd2; local
541 int fd1, fd2; local
587 int *fd2 = malloc(nprocs * sizeof(int)); local
631 int *fd2 = malloc(nprocs * sizeof(int)); local
675 int *fd2 = malloc(nprocs * sizeof(int)); local
719 int *fd2 = malloc(nprocs * sizeof(int)); local
[all...]
/linux-master/tools/testing/selftests/filelock/
H A Dofdlocks.c40 int fd2 = open("/tmp/aa", O_RDONLY); local
44 assert(fd2 != -1);
45 ksft_print_msg("[INFO] opened fds %i %i\n", fd, fd2);
63 rc = lock_get(fd2, &fl);
74 rc = lock_get(fd2, &fl);
125 lock_get(fd2, &fl);
/linux-master/tools/perf/tests/
H A Dbp_signal.c33 static int fd2; variable
76 ioctl(fd2, PERF_EVENT_IOC_DISABLE, 0);
97 ioctl(fd2, PERF_EVENT_IOC_DISABLE, 0);
197 * fd2 - breakpoint event on sig_handler with SIGUSR1
208 * sig_handler - fd2 event breakpoint hit -> count2 == 1
216 * sig_handler - fd2 event breakpoint hit -> count2 == 2
224 * sig_handler - fd2 event breakpoint hit -> count2 == 3
242 fd2 = bp_event(sig_handler, SIGUSR1);
246 ioctl(fd2, PERF_EVENT_IOC_ENABLE, 0);
256 ioctl(fd2, PERF_EVENT_IOC_DISABL
[all...]
/linux-master/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) argument
25 return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2);
37 int fd1, fd2; local
94 fd2 = open(kpath, O_RDWR, 0644);
95 if (fd2 < 0) {
105 sys_kcmp(pid1, pid2, KCMP_FILE, fd1, fd2),
/linux-master/tools/testing/selftests/memfd/
H A Dmemfd_test.c569 int r, fd2; local
579 fd2 = mfd_assert_open(fd,
582 close(fd2);
948 int fd, fd2; local
969 fd2 = mfd_assert_reopen_fd(fd);
971 mfd_assert_read(fd2);
972 mfd_assert_read_shared(fd2);
973 mfd_fail_write(fd2);
978 close(fd2);
1417 int fd, fd2; local
1493 int fd, fd2; local
[all...]
/linux-master/tools/testing/selftests/core/
H A Dclose_range_test.c361 int fd1, fd2, fd3, flags, ret, status; local
372 fd2 = dup2(fd1, 1000);
373 EXPECT_GT(fd2, 0);
392 flags = fcntl(fd2, F_GETFD);
422 flags = fcntl(fd2, F_GETFD);
434 EXPECT_EQ(close(fd2), 0);
443 int i, fd1, fd2, fd3, flags, ret, status; local
464 fd2 = dup2(fd1, 1000);
465 EXPECT_GT(fd2, 0);
487 flags = fcntl(fd2, F_GETF
[all...]
/linux-master/include/uapi/linux/
H A Dsync_file.h21 * @fd2: file descriptor of second fence
27 * the calling fd and sync_merge_data.fd2. Returns the new fence's
32 __s32 fd2; member in struct:sync_merge_data
/linux-master/tools/testing/selftests/kvm/
H A Dguest_memfd_test.c149 int fd1, fd2, ret; local
159 fd2 = __vm_create_guest_memfd(vm, 8192, 0);
160 TEST_ASSERT(fd2 != -1, "memfd creation should succeed");
162 ret = fstat(fd2, &st2);
171 close(fd2);
/linux-master/include/linux/
H A Daudit.h409 extern void __audit_fd_pair(int fd1, int fd2);
432 static inline void audit_fd_pair(int fd1, int fd2) argument
435 __audit_fd_pair(fd1, fd2);
648 static inline void audit_fd_pair(int fd1, int fd2) argument
/linux-master/scripts/kconfig/
H A Dconfdata.c48 int fd1, fd2; local
57 fd2 = open(file2, O_RDONLY);
58 if (fd2 < 0)
64 ret = fstat(fd2, &st2);
75 map2 = mmap(NULL, st2.st_size, PROT_READ, MAP_PRIVATE, fd2, 0);
84 close(fd2);

Completed in 410 milliseconds

12