| /freebsd-13.1/tests/sys/file/ |
| H A D | dup_test.c | 105 if (fd2 != fd1 + 1) in main() 151 if (fd2 != fd1) in main() 168 if (fd2 < 10) in main() 170 ++test, fd2); in main() 198 if (fd2 != fd1 + 1) in main() 223 if (fd2 != fd1) in main() 254 if (fd2 < 10) in main() 256 ++test, fd2); in main() 277 if (fd2 != fd1 + 1) in main() 317 if (fd2 != fd1 + 1) in main() [all …]
|
| /freebsd-13.1/lib/libutil/tests/ |
| H A D | flopen_test.c | 99 int fd1, fd2; in test_flopen_lock_self() local 106 fd2 = flopen(fn, O_RDWR|O_NONBLOCK); in test_flopen_lock_self() 107 if (fd2 >= 0) { in test_flopen_lock_self() 109 close(fd2); in test_flopen_lock_self() 125 volatile int fd1, fd2; in test_flopen_lock_other() local 132 fd2 = -42; in test_flopen_lock_other() 135 close(fd2); in test_flopen_lock_other() 138 if (fd2 == -42) in test_flopen_lock_other() 140 if (fd2 >= 0) in test_flopen_lock_other() 157 volatile int fd1, fd2; in test_flopen_lock_child() local [all …]
|
| /freebsd-13.1/tools/tools/netrate/juggle/ |
| H A D | juggle.c | 251 if (message_recv(fd2) < 0) in juggle() 254 if (message_send(fd2) < 0) in juggle() 288 int fd2, i, j; in juggling_thread() local 290 fd2 = *(int *)arg; in juggling_thread() 305 if (message_recv(fd2) < 0) in juggling_thread() 308 if (message_send(fd2) < 0) in juggling_thread() 389 if (message_send(fd2) < 0) { in process_juggle() 398 if (message_send(fd2) < 0) in process_juggle() 485 int fd1, fd2, i, j, p; in main() local 519 juggle(fd1, fd2, p); in main() [all …]
|
| /freebsd-13.1/tools/regression/sockets/unix_cmsg/ |
| H A D | t_cmsgcred.c | 86 int fd2, rv; in t_cmsgcred_server() local 91 fd2 = -1; in t_cmsgcred_server() 102 fd2 = uc_socket_accept(fd1); in t_cmsgcred_server() 103 if (fd2 < 0) in t_cmsgcred_server() 106 fd2 = fd1; in t_cmsgcred_server() 113 if (uc_message_recv(fd2, &msghdr) < 0) { in t_cmsgcred_server() 129 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) in t_cmsgcred_server() 130 if (uc_socket_close(fd2) < 0) in t_cmsgcred_server()
|
| H A D | t_cmsgcred_sockcred.c | 52 int fd2, rv, val; in t_cmsgcred_sockcred_server() local 54 fd2 = -1; in t_cmsgcred_sockcred_server() 77 fd2 = uc_socket_accept(fd1); in t_cmsgcred_sockcred_server() 78 if (fd2 < 0) in t_cmsgcred_sockcred_server() 81 fd2 = fd1; in t_cmsgcred_sockcred_server() 90 if (uc_message_recv(fd2, &msghdr) < 0) { in t_cmsgcred_sockcred_server() 115 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) in t_cmsgcred_sockcred_server() 116 if (uc_socket_close(fd2) < 0) in t_cmsgcred_sockcred_server()
|
| H A D | t_sockcred.c | 80 int fd2, rv, val; in t_sockcred_server() local 82 fd2 = -1; in t_sockcred_server() 105 fd2 = uc_socket_accept(fd1); in t_sockcred_server() 106 if (fd2 < 0) in t_sockcred_server() 109 fd2 = fd1; in t_sockcred_server() 114 if (setsockopt(fd2, 0, LOCAL_CREDS, &val, sizeof(val)) < 0) { in t_sockcred_server() 127 if (uc_message_recv(fd2, &msghdr) < 0) { in t_sockcred_server() 148 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) in t_sockcred_server() 149 if (uc_socket_close(fd2) < 0) in t_sockcred_server()
|
| H A D | t_cmsg_len.c | 108 int fd2, rv; in t_cmsg_len_server() local 116 fd2 = uc_socket_accept(fd1); in t_cmsg_len_server() 117 if (fd2 < 0) in t_cmsg_len_server() 120 fd2 = fd1; in t_cmsg_len_server() 127 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) in t_cmsg_len_server() 128 if (uc_socket_close(fd2) < 0) in t_cmsg_len_server()
|
| H A D | t_peercred.c | 121 int fd2, rv; in t_peercred_server() local 126 fd2 = uc_socket_accept(fd1); in t_peercred_server() 127 if (fd2 < 0) in t_peercred_server() 131 if (getsockopt(fd2, 0, LOCAL_PEERCRED, &xucred, &len) < 0) { in t_peercred_server() 144 if (uc_socket_close(fd2) < 0) in t_peercred_server()
|
| H A D | t_xxxtime.c.in | 108 int fd2, rv; variable 113 fd2 = -1; 124 fd2 = uc_socket_accept(fd1); 125 if (fd2 < 0) 128 fd2 = fd1; 135 if (uc_message_recv(fd2, &msghdr) < 0) { 151 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) 152 if (uc_socket_close(fd2) < 0)
|
| /freebsd-13.1/tests/sys/fs/fusefs/ |
| H A D | copy_file_range.cc | 155 int fd1, fd2; in TEST_F() local 202 int fd1, fd2; in TEST_F() local 257 leak(fd2); in TEST_F() 279 int fd1, fd2; in TEST_F() local 333 int fd1, fd2; in TEST_F() local 373 int fd1, fd2; in TEST_F() local 462 int fd1, fd2; in TEST_F() local 507 leak(fd2); in TEST_F() 573 int fd1, fd2; in TEST_F() local 622 int fd1, fd2; in TEST_F() local [all …]
|
| H A D | flush.cc | 97 int fd, fd2; in TEST_F() local 107 fd2 = open(FULLPATH, O_WRONLY); in TEST_F() 108 ASSERT_LE(0, fd2) << strerror(errno); in TEST_F() 110 EXPECT_EQ(0, close(fd2)) << strerror(errno); in TEST_F() 203 int fd, fd2; in TEST_F() local 239 fd2 = open(FULLPATH, O_WRONLY); in TEST_F() 240 ASSERT_LE(0, fd2) << strerror(errno); in TEST_F() 241 ASSERT_EQ(0, close(fd2)) << strerror(errno); in TEST_F() 243 leak(fd2); in TEST_F()
|
| H A D | release.cc | 82 int fd, fd2; in TEST_F() local 92 fd2 = dup(fd); in TEST_F() 93 ASSERT_LE(0, fd2) << strerror(errno); in TEST_F() 95 ASSERT_EQ(0, close(fd2)) << strerror(errno); in TEST_F() 157 int fd, fd2; in TEST_F() local 168 fd2 = open(FULLPATH, O_WRONLY); in TEST_F() 169 ASSERT_LE(0, fd2) << strerror(errno); in TEST_F() 171 ASSERT_EQ(0, close(fd2)) << strerror(errno); in TEST_F()
|
| /freebsd-13.1/contrib/netbsd-tests/lib/libc/sys/ |
| H A D | t_dup.c | 60 int fd, fd1, fd2; in check_mode() local 75 ATF_REQUIRE(fd2 >= 0); in check_mode() 80 fd = dup2(fd1, fd2); in check_mode() 82 fd = dup3(fd1, fd2, O_CLOEXEC); in check_mode() 100 (void)close(fd2); in check_mode() 114 int fd, fd1, fd2; in ATF_TC_BODY() local 117 fd2 = open("/etc/passwd", O_RDONLY); in ATF_TC_BODY() 120 ATF_REQUIRE(fd2 >= 0); in ATF_TC_BODY() 122 fd = dup2(fd1, fd2); in ATF_TC_BODY() 125 if (fd != fd2) in ATF_TC_BODY() [all …]
|
| /freebsd-13.1/tools/regression/sockets/accept_fd_leak/ |
| H A D | accept_fd_leak.c | 70 int fd1, fd2, fd3, i, listen_port, s, status; in main() local 78 fd2 = dup(STDIN_FILENO); in main() 79 if (fd2 != fd1 + 1) in main() 135 if (fd3 != fd2 + 2) in main() 136 printf("not ok 1 - (%d, %d, %d)\n", fd1, fd2, fd3); in main() 155 close(fd2); in main() 209 if (fd3 != fd2 + 2) in main() 210 printf("not ok 2 - (%d, %d, %d)\n", fd1, fd2, fd3); in main()
|
| /freebsd-13.1/usr.bin/cmp/ |
| H A D | cmp.c | 104 int ch, fd1, fd2, oflag; in main() local 182 fd2 = STDIN_FILENO; in main() 184 } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { in main() 205 if (fd2 == -1) { in main() 212 } else if (fd2 == -1) { in main() 232 if (fstat(fd2, &sb2)) { in main() 244 c_special(fd1, file1, skip1, fd2, file2, skip2, limit); in main() 253 fd2, file2, skip2, sb2.st_size, limit); in main()
|
| H A D | regular.c | 63 int fd2, const char *file2, off_t skip2, off_t len2, off_t limit) in c_regular() argument 93 c_special(fd1, file1, skip1, fd2, file2, skip2, limit); in c_regular() 97 if ((m2 = remmap(NULL, fd2, off2)) == NULL) { in c_regular() 99 c_special(fd1, file1, skip1, fd2, file2, skip2, limit); in c_regular() 105 if (caph_rights_limit(fd2, cap_rights_init(&rights, CAP_MMAP_R)) < 0) in c_regular() 152 if ((p2 = m2 = remmap(m2, fd2, off2)) == NULL) { in c_regular()
|
| /freebsd-13.1/tests/sys/kern/ |
| H A D | kern_descrip_test.c | 60 int fd1, fd2; in ATF_TC_BODY() local 64 fd2 = 27; in ATF_TC_BODY() 65 ATF_REQUIRE(dup2(fd1, fd2) != -1); in ATF_TC_BODY() 67 ATF_REQUIRE(fstat(fd2, &sb2) != -1); in ATF_TC_BODY() 79 int fd1, fd2, ret; in ATF_TC_BODY() local 82 fd2 = INT_MAX; in ATF_TC_BODY() 83 ret = dup2(fd1, fd2); in ATF_TC_BODY()
|
| /freebsd-13.1/tools/regression/nfsmmap/test2/ |
| H A D | test2.c | 8 int fd, fd2; in main() local 38 fd2 = open("test2.scratch", O_RDWR|O_CREAT, 0666); in main() 39 if (fd2 < 0) in main() 42 if (write(fd2, addr, 4096) < 0) in main()
|
| /freebsd-13.1/tools/regression/nfsmmap/test1/ |
| H A D | test1.c | 8 int fd, fd2; in main() local 40 fd2 = open("test1.scratch", O_RDWR|O_CREAT, 0666); in main() 41 if (fd2 < 0) in main() 44 if (write(fd2, addr, 4096) < 0) in main()
|
| /freebsd-13.1/lib/libc/gen/ |
| H A D | opendir.c | 120 int fd2, incr, len, n, saved_errno, space; in _filldir() local 150 if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) in _filldir() 155 if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { in _filldir() 157 _close(fd2); in _filldir() 174 _close(fd2); in _filldir() 181 n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); in _filldir() 188 _close(fd2); in _filldir() 193 _close(fd2); in _filldir()
|
| /freebsd-13.1/tests/sys/fifo/ |
| H A D | fifo_misc.c | 72 cleanfifo(const char *fifoname, int fd1, int fd2) in cleanfifo() argument 77 if (fd2 != -1) in cleanfifo() 78 close(fd2); in cleanfifo() 85 int error, fd1, fd2; in openfifo() local 90 fd2 = open(fifoname, O_WRONLY | O_NONBLOCK); in openfifo() 91 if (fd2 < 0) { in openfifo() 98 *writer_fdp = fd2; in openfifo()
|
| /freebsd-13.1/sys/contrib/openzfs/tests/zfs-tests/cmd/get_diff/ |
| H A D | get_diff.c | 46 int fd1, fd2; in main() local 63 if ((fd2 = open(fname2, O_LARGEFILE | O_RDONLY)) < 0) { in main() 69 if (pread(fd2, buf2, DEV_BSIZE, off) < 0) { in main() 106 (void) close(fd2); in main()
|
| /freebsd-13.1/contrib/netbsd-tests/kernel/kqueue/read/ |
| H A D | t_file2.c | 56 int fd1, fd2, kq; in ATF_TC_BODY() local 60 RL(fd2 = open("bfile", O_RDONLY|O_CREAT, 0644)); in ATF_TC_BODY() 71 RL(dup2(fd2, fd1)); in ATF_TC_BODY()
|
| /freebsd-13.1/contrib/ntp/sntp/libevent/test/ |
| H A D | regress_listener.c | 81 evutil_socket_t fd1 = -1, fd2 = -1, fd3 = -1; in regress_pick_a_port() local 117 fd1 = fd2 = fd3 = -1; in regress_pick_a_port() 119 evutil_socket_connect_(&fd2, (struct sockaddr*)&ss1, slen1); in regress_pick_a_port() 133 if (fd2>=0) in regress_pick_a_port() 134 EVUTIL_CLOSESOCKET(fd2); in regress_pick_a_port()
|
| /freebsd-13.1/contrib/libevent/test/ |
| H A D | regress_listener.c | 84 evutil_socket_t fd1 = -1, fd2 = -1, fd3 = -1; in regress_pick_a_port() local 120 fd1 = fd2 = fd3 = -1; in regress_pick_a_port() 122 evutil_socket_connect_(&fd2, (struct sockaddr*)&ss1, slen1); in regress_pick_a_port() 136 if (fd2>=0) in regress_pick_a_port() 137 EVUTIL_CLOSESOCKET(fd2); in regress_pick_a_port()
|