Home
last modified time | relevance | path

Searched refs:fd2 (Results 1 – 25 of 50) sorted by relevance

12

/openbsd-src/regress/lib/libc/sys/
H A Dt_dup.c59 int fd, fd1, fd2; in check_mode() local
71 fd2 = open("/etc/passwd", O_RDONLY); in check_mode()
74 ATF_REQUIRE(fd2 >= 0); in check_mode()
79 fd = dup2(fd1, fd2); in check_mode()
81 fd = dup3(fd1, fd2, O_CLOEXEC); in check_mode()
99 (void)close(fd2); in check_mode()
113 int fd, fd1, fd2; in ATF_TC_BODY() local
116 fd2 = open("/etc/passwd", O_RDONLY); in ATF_TC_BODY()
119 ATF_REQUIRE(fd2 >= 0); in ATF_TC_BODY()
121 fd = dup2(fd1, fd2); in ATF_TC_BODY()
[all …]
/openbsd-src/usr.bin/cmp/
H A Dcmp.c57 int ch, fd1, fd2, special; in main() local
96 fd2 = 0; in main()
98 } else if ((fd2 = open(file2, O_RDONLY)) == -1) in main()
113 if (fstat(fd2, &sb2) == -1) in main()
121 c_special(fd1, file1, skip1, fd2, file2, skip2); in main()
124 fd2, file2, skip2, sb2.st_size); in main()
H A Dregular.c48 int fd2, char *file2, off_t skip2, off_t len2) in c_regular() argument
67 c_special(fd1, file1, skip1, fd2, file2, skip2); in c_regular()
75 MAP_PRIVATE, fd2, skip2)) == MAP_FAILED) { in c_regular()
H A Dspecial.c43 c_special(int fd1, char *file1, off_t skip1, int fd2, char *file2, off_t skip2) in c_special() argument
52 if ((fp2 = fdopen(fd2, "r")) == NULL) in c_special()
/openbsd-src/regress/sys/kern/dup2_self/
H A Ddup2_self.c34 int orgfd, fd1, fd2; in main() local
51 if ((fd2 = dup2(fd1, fd1)) < 0) in main()
55 if (fd2 != fd1) in main()
59 if (fcntl(fd2, F_GETFD) == 0) in main()
/openbsd-src/regress/sys/kern/dup2/
H A Ddup2test.c14 int orgfd, fd1, fd2; in main() local
31 if ((fd2 = dup2(fd1, fd1 + 1)) < 0) in main()
35 if (fd2 != fd1 + 1) in main()
39 if (fcntl(fd2, F_GETFD) != 0) in main()
/openbsd-src/regress/sys/kern/bind/
H A Dbind.c11 int fd1, fd2, enable = 1; in main() local
36 if ((fd2 = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) in main()
39 if (setsockopt(fd2, SOL_SOCKET, SO_REUSEPORT, &enable, in main()
43 if (bind(fd2, (struct sockaddr *)&addr2, sizeof(addr2)) == -1) in main()
/openbsd-src/regress/sys/kern/unveil/
H A Dsocket.c15 int c_fd1, c_fd2, fd1, fd2, fd3; in test_bind_unix_socket() local
72 if ((fd2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) in test_bind_unix_socket()
75 (bind(fd2, (struct sockaddr *)&sun2, sizeof(sun2)) == -1), "bind"); in test_bind_unix_socket()
76 if (listen(fd2, 5) == -1) in test_bind_unix_socket()
100 close(fd2); in test_bind_unix_socket()
H A Dunveil.h103 int fd1, fd2; in test_setup() local
111 UV_SHOULD_SUCCEED(((fd2 = mkstemp(uv_file2)) == -1), "mkstemp"); in test_setup()
116 close(fd2); in test_setup()
/openbsd-src/regress/sys/kern/fcntl_dup/
H A Dfcntl_dup.c14 int orgfd, fd1, fd2; in main() local
31 if ((fd2 = fcntl(fd1, F_DUPFD, 0)) < 0) in main()
35 if (fcntl(fd2, F_GETFD) != 0) in main()
/openbsd-src/usr.bin/cvs/
H A Ddiff.c304 int fd1, fd2; in cvs_diff_local() local
311 fd1 = fd2 = -1; in cvs_diff_local()
506 fd2 = rcs_rev_write_stmp(cf->file_rcs, diff_rev2, p2, 0); in cvs_diff_local()
507 if (futimes(fd2, tv2) == -1) in cvs_diff_local()
519 fd2 = rcs_rev_write_stmp(cf->file_rcs, in cvs_diff_local()
521 if (futimes(fd2, tv2) == -1) in cvs_diff_local()
532 fd2 = buf_write_stmp(b1, p2, tv2); in cvs_diff_local()
592 if (fd2 == -1) { in cvs_diff_local()
593 if ((fd2 = open(CVS_PATH_DEVNULL, O_RDONLY)) == -1) in cvs_diff_local()
598 p2 != NULL ? cf->file_path : CVS_PATH_DEVNULL, fd1, fd2, NULL, in cvs_diff_local()
[all …]
H A Dimport.c474 int fd1, fd2; in import_get_rcsdiff() local
485 fd2 = rcs_rev_write_stmp(cf->file_rcs, rev, p2, RCS_KWEXP_NONE); in import_get_rcsdiff()
488 if (diffreg(p2, p1, fd2, fd1, b2, D_FORCEASCII) == D_ERROR) in import_get_rcsdiff()
492 close(fd2); in import_get_rcsdiff()
/openbsd-src/gnu/llvm/lldb/examples/interposing/darwin/fd_interposing/
H A DFDInterposing.cpp732 extern "C" int dup$__interposed__(int fd2) { in dup$__interposed__() argument
736 const int fd = ::dup(fd2); in dup$__interposed__()
739 new String("pid=%i: dup (fd2=%i) -> fd=%i", pid, fd2, fd)); in dup$__interposed__()
746 return ::dup(fd2); in dup$__interposed__()
751 extern "C" int dup2$__interposed__(int fd1, int fd2) { in dup2$__interposed__() argument
758 FDEventMap::iterator pos = g_fd_event_map.find(fd2); in dup2$__interposed__()
761 fd1, fd2, fd2)); in dup2$__interposed__()
763 save_backtrace(fd2, 0, dup2_close_description_sp, false); in dup2$__interposed__()
765 const int fd = ::dup2(fd1, fd2); in dup2$__interposed__()
768 pid, fd1, fd2, fd)); in dup2$__interposed__()
[all …]
/openbsd-src/usr.sbin/smtpd/
H A Dqueue_ram.c150 int fd, fd2; in queue_ram_message_fd_r() local
163 fd2 = dup(fd); in queue_ram_message_fd_r()
164 if (fd2 == -1) { in queue_ram_message_fd_r()
169 f = fdopen(fd2, "w"); in queue_ram_message_fd_r()
173 close(fd2); in queue_ram_message_fd_r()
/openbsd-src/gnu/lib/libiberty/src/
H A Dfdmatch.c52 int fdmatch (int fd1, int fd2) in fdmatch() argument
58 (fstat (fd2, &sbuf2) == 0) && in fdmatch()
/openbsd-src/gnu/usr.bin/cvs/emx/
H A Dfilesubr.c560 int fd1, fd2; local
565 if ((fd2 = open (file2, O_RDONLY | O_BINARY)) < 0)
569 if (fstat (fd2, &sb2) < 0)
597 read2 = block_read (fd2, buf2, buf_size);
611 (void) close (fd2);
/openbsd-src/bin/pax/
H A Dbuf_subs.c752 cp_file(ARCHD *arcn, int fd1, int fd2) in cp_file() argument
775 if (fstat(fd2, &sb) == 0) { in cp_file()
789 res = write(fd2, buf, cnt); in cp_file()
791 res = file_write(fd2, buf, cnt, &rem, &isem, sz, fnm); in cp_file()
819 file_flush(fd2, fnm, isem); in cp_file()
/openbsd-src/regress/sys/dev/video/
H A Dvideotest.c283 int fd1, fd2; in test_capture() local
407 fd2 = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0644); in test_capture()
408 if (fd2 == -1) in test_capture()
410 n2 = write(fd2, img, img_len); in test_capture()
414 close(fd2); in test_capture()
/openbsd-src/gnu/usr.bin/cvs/os2/
H A Dfilesubr.c535 int fd1, fd2; local
540 if ((fd2 = open (file2, O_RDONLY | O_BINARY)) < 0)
544 if (fstat (fd2, &sb2) < 0)
572 read2 = block_read (fd2, buf2, buf_size);
586 (void) close (fd2);
/openbsd-src/gnu/lib/libstdc++/libstdc++/testsuite/22_locale/
H A Dmoneypunct_byname.cc71 int fd2 = monp_byname.frac_digits(); in test01() local
81 VERIFY( fd1 == fd2 ); in test01()
H A Dmoneypunct_members_char.cc86 int fd2 = monp_de_t.frac_digits(); in test01() local
96 VERIFY( fd1 != fd2 ); in test01()
/openbsd-src/gnu/usr.bin/perl/ext/PerlIO-via/t/
H A Dvia.t51 my $fd2 = open($fh,'<',$tmp) && fileno($fh);
52 is($fd2,$fd,"Wrong fd number after failed open");
/openbsd-src/gnu/usr.bin/cvs/windows-NT/
H A Dfilesubr.c602 int fd1, fd2; local
607 if ((fd2 = open (file2, O_RDONLY | O_BINARY)) < 0)
611 if (fstat (fd2, &sb2) < 0)
639 read2 = block_read (fd2, buf2, buf_size);
653 (void) close (fd2);
/openbsd-src/gnu/usr.bin/cvs/vms/
H A Dfilesubr.c590 int fd1, fd2; local
608 if ((fd2 = open (file2, O_RDONLY)) < 0)
612 if (fstat (fd2, &sb2) < 0)
640 read2 = block_read (fd2, buf2, buf_size);
654 (void) close (fd2);
/openbsd-src/sbin/resolvd/
H A Dresolvd.c637 int fd2; in regen_resolvconf() local
639 if ((fd2 = dup(resolvfd)) == -1) in regen_resolvconf()
641 lseek(fd2, 0, SEEK_SET); in regen_resolvconf()
642 fp = fdopen(fd2, "r"); in regen_resolvconf()
644 close(fd2); in regen_resolvconf()

12