/freebsd-11-stable/tests/sys/file/ |
H A D | dup_test.c | 83 int orgfd, fd1, fd2, test = 0; local 99 if ((fd2 = dup2(fd1, fd1 + 1)) < 0) 105 if (fd2 != fd1 + 1) 113 if (fcntl(fd2, F_GETFD) != 0) 145 if ((fd2 = dup2(fd1, fd1)) < 0) 151 if (fd2 != fd1) 160 if (fcntl(fd2, F_GETFD) == 0) 166 if ((fd2 = fcntl(fd1, F_DUPFD, 10)) < 0) 168 if (fd2 < 10) 170 ++test, fd2); [all...] |
/freebsd-11-stable/contrib/gcclibs/libiberty/ |
H A D | fdmatch.c | 23 @deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2}) 52 int fdmatch (int fd1, int fd2) argument 58 (fstat (fd2, &sbuf2) == 0) &&
|
/freebsd-11-stable/contrib/binutils/libiberty/ |
H A D | fdmatch.c | 23 @deftypefn Extension int fdmatch (int @var{fd1}, int @var{fd2}) 52 int fdmatch (int fd1, int fd2) argument 58 (fstat (fd2, &sbuf2) == 0) &&
|
/freebsd-11-stable/lib/libutil/tests/ |
H A D | flopen_test.c | 99 int fd1, fd2; local 106 fd2 = flopen(fn, O_RDWR|O_NONBLOCK); 107 if (fd2 >= 0) { 109 close(fd2); 125 volatile int fd1, fd2; local 132 fd2 = -42; 134 fd2 = flopen(fn, O_RDWR|O_NONBLOCK); 135 close(fd2); 138 if (fd2 == -42) 140 if (fd2 > 157 volatile int fd1, fd2; local [all...] |
/freebsd-11-stable/tools/regression/nfsmmap/test1/ |
H A D | test1.c | 8 int fd, fd2; local 40 fd2 = open("test1.scratch", O_RDWR|O_CREAT, 0666); 41 if (fd2 < 0) 44 if (write(fd2, addr, 4096) < 0)
|
/freebsd-11-stable/tools/regression/nfsmmap/test2/ |
H A D | test2.c | 8 int fd, fd2; local 38 fd2 = open("test2.scratch", O_RDWR|O_CREAT, 0666); 39 if (fd2 < 0) 42 if (write(fd2, addr, 4096) < 0)
|
/freebsd-11-stable/tools/regression/sockets/unix_cmsg/ |
H A D | t_cmsgcred_sockcred.c | 52 int fd2, rv, val; local 54 fd2 = -1; 77 fd2 = uc_socket_accept(fd1); 78 if (fd2 < 0) 81 fd2 = fd1; 90 if (uc_message_recv(fd2, &msghdr) < 0) { 115 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) 116 if (uc_socket_close(fd2) < 0)
|
H A D | t_cmsgcred.c | 86 int fd2, rv; local 91 fd2 = -1; 102 fd2 = uc_socket_accept(fd1); 103 if (fd2 < 0) 106 fd2 = fd1; 113 if (uc_message_recv(fd2, &msghdr) < 0) { 129 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) 130 if (uc_socket_close(fd2) < 0)
|
H A D | t_sockcred.c | 80 int fd2, rv, val; local 82 fd2 = -1; 105 fd2 = uc_socket_accept(fd1); 106 if (fd2 < 0) 109 fd2 = fd1; 114 if (setsockopt(fd2, 0, LOCAL_CREDS, &val, sizeof(val)) < 0) { 127 if (uc_message_recv(fd2, &msghdr) < 0) { 148 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) 149 if (uc_socket_close(fd2) < 0)
|
H A D | t_cmsg_len.c | 108 int fd2, rv; local 116 fd2 = uc_socket_accept(fd1); 117 if (fd2 < 0) 120 fd2 = fd1; 127 if (uc_cfg.sock_type == SOCK_STREAM && fd2 >= 0) 128 if (uc_socket_close(fd2) < 0)
|
H A D | t_peercred.c | 121 int fd2, rv; local 126 fd2 = uc_socket_accept(fd1); 127 if (fd2 < 0) 131 if (getsockopt(fd2, 0, LOCAL_PEERCRED, &xucred, &len) < 0) { 144 if (uc_socket_close(fd2) < 0)
|
/freebsd-11-stable/contrib/netbsd-tests/kernel/kqueue/read/ |
H A D | t_file2.c | 56 int fd1, fd2, kq; local 60 RL(fd2 = open("bfile", O_RDONLY|O_CREAT, 0644)); 71 RL(dup2(fd2, fd1));
|
/freebsd-11-stable/usr.bin/cmp/ |
H A D | cmp.c | 76 int ch, fd1, fd2, oflag, special; local 130 fd2 = 0; 133 else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { 144 if (fd2 == -1) { 151 } else if (fd2 == -1) { 168 if (fstat(fd2, &sb2)) { 180 c_special(fd1, file1, skip1, fd2, file2, skip2); 189 fd2, file2, skip2, sb2.st_size);
|
H A D | special.c | 49 int fd2, const char *file2, off_t skip2) 58 if ((fp2 = fdopen(fd2, "r")) == NULL) 48 c_special(int fd1, const char *file1, off_t skip1, int fd2, const char *file2, off_t skip2) argument
|
H A D | regular.c | 60 int fd2, const char *file2, off_t skip2, off_t len2) 93 c_special(fd1, file1, skip1, fd2, file2, skip2); 97 if ((m2 = remmap(NULL, fd2, off2)) == NULL) { 99 c_special(fd1, file1, skip1, fd2, file2, skip2); 135 if ((p2 = m2 = remmap(m2, fd2, off2)) == NULL) { 59 c_regular(int fd1, const char *file1, off_t skip1, off_t len1, int fd2, const char *file2, off_t skip2, off_t len2) argument
|
/freebsd-11-stable/tools/regression/sockets/accept_fd_leak/ |
H A D | accept_fd_leak.c | 70 int fd1, fd2, fd3, i, listen_port, s, status; local 78 fd2 = dup(STDIN_FILENO); 79 if (fd2 != fd1 + 1) 131 * Allocate a file descriptor and make sure it's fd2+2. 2 because 135 if (fd3 != fd2 + 2) 136 printf("not ok 1 - (%d, %d, %d)\n", fd1, fd2, fd3); 155 close(fd2); 205 * Allocate a file descriptor and make sure it's fd2+2. 2 because 209 if (fd3 != fd2 + 2) 210 printf("not ok 2 - (%d, %d, %d)\n", fd1, fd2, fd [all...] |
/freebsd-11-stable/tools/tools/netrate/juggle/ |
H A D | juggle.c | 77 * Number of message cycles -- into fd1, out of fd2, into fd2, and out of 248 juggle(int fd1, int fd2, int pipeline) argument 264 if (message_recv(fd2) < 0) 265 err(-1, "message_recv fd2"); 267 if (message_send(fd2) < 0) 268 err(-1, "message_send fd2"); 301 int fd2, i, j; local 303 fd2 = *(int *)arg; 318 if (message_recv(fd2) < 330 thread_juggle(int fd1, int fd2, int pipeline) argument 389 process_juggle(int fd1, int fd2, int pipeline) argument 498 int fd1, fd2, i, j, p; local [all...] |
/freebsd-11-stable/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_dup.c | 60 int fd, fd1, fd2; local 72 fd2 = open("/etc/passwd", O_RDONLY); 75 ATF_REQUIRE(fd2 >= 0); 80 fd = dup2(fd1, fd2); 82 fd = dup3(fd1, fd2, O_CLOEXEC); 100 (void)close(fd2); 114 int fd, fd1, fd2; local 117 fd2 = open("/etc/passwd", O_RDONLY); 120 ATF_REQUIRE(fd2 >= 0); 122 fd = dup2(fd1, fd2); [all...] |
/freebsd-11-stable/tests/sys/kern/ |
H A D | kern_descrip_test.c | 54 int fd1, fd2; local 58 fd2 = 27; 59 ATF_REQUIRE(dup2(fd1, fd2) != -1); 61 ATF_REQUIRE(fstat(fd2, &sb2) != -1); 73 int fd1, fd2, ret; local 76 fd2 = INT_MAX; 77 ret = dup2(fd1, fd2);
|
/freebsd-11-stable/lib/libc/gen/ |
H A D | opendir.c | 122 int fd2, incr, len, n, saved_errno, space; local 152 if ((fd2 = _openat(dirp->dd_fd, ".", O_RDONLY | O_CLOEXEC)) == -1) 157 if (pos == -1 || lseek(fd2, pos, SEEK_SET) == -1) { 159 _close(fd2); 176 _close(fd2); 183 n = _getdirentries(fd2, ddptr, space, &dirp->dd_seek); 190 _close(fd2); 195 _close(fd2);
|
/freebsd-11-stable/contrib/ntp/sntp/libevent/test/ |
H A D | regress_listener.c | 81 evutil_socket_t fd1 = -1, fd2 = -1, fd3 = -1; local 117 fd1 = fd2 = fd3 = -1; 119 evutil_socket_connect_(&fd2, (struct sockaddr*)&ss1, slen1); 133 if (fd2>=0) 134 EVUTIL_CLOSESOCKET(fd2);
|
/freebsd-11-stable/sbin/nvmecontrol/ |
H A D | wdc.c | 105 int fd2; local 113 fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644); 114 if (fd2 < 0) 145 if (write(fd2, buf, resid) != (ssize_t)resid) 151 close(fd2);
|
/freebsd-11-stable/tests/sys/fifo/ |
H A D | fifo_misc.c | 72 cleanfifo(const char *fifoname, int fd1, int fd2) argument 77 if (fd2 != -1) 78 close(fd2); 85 int error, fd1, fd2; local 90 fd2 = open(fifoname, O_WRONLY | O_NONBLOCK); 91 if (fd2 < 0) { 98 *writer_fdp = fd2;
|
/freebsd-11-stable/tools/test/upsdl/ |
H A D | upsdl.c | 39 int mapBuffer(char** bufferp,int fd1,int fd2); 97 /* mmap a 2 page buffer - first page is from fd1, second page from fd2 */ 98 int mapBuffer(char** bufferp,int fd1,int fd2) argument 112 MAP_SHARED, fd2, 0);
|
/freebsd-11-stable/tools/regression/security/cap_test/ |
H A D | cap_test_capmode.c | 71 int fd_close, fd_dir, fd_file, fd_socket, fd2[2]; local 181 if (pipe(fd2) == 0) { 182 close(fd2[0]); 183 close(fd2[1]);
|