Home
last modified time | relevance | path

Searched refs:ttyfd (Results 1 – 22 of 22) sorted by relevance

/netbsd/src/external/bsd/tmux/dist/
Dosdep-aix.c34 int f, ttyfd, retval; in osdep_get_name() local
37 if ((ttyfd = open(tty, O_RDONLY|O_NOCTTY)) == -1) in osdep_get_name()
40 retval = ioctl(ttyfd, TIOCGPGRP, &pgrp); in osdep_get_name()
41 close(ttyfd); in osdep_get_name()
67 int len, retval, ttyfd; in osdep_get_cwd() local
71 if ((ttyfd = open(ttypath, O_RDONLY|O_NOCTTY)) == -1) in osdep_get_cwd()
74 retval = ioctl(ttyfd, TIOCGPGRP, &pgrp); in osdep_get_cwd()
75 close(ttyfd); in osdep_get_cwd()
Dosdep-sunos.c74 int retval, ttyfd; in osdep_get_cwd() local
78 if ((ttyfd = open(ttypath, O_RDONLY|O_NOCTTY)) == -1) in osdep_get_cwd()
81 retval = ioctl(ttyfd, TIOCGPGRP, &pgrp); in osdep_get_cwd()
82 close(ttyfd); in osdep_get_cwd()
/netbsd/src/usr.bin/write/
Dwrite.c79 int msgsok, ttyfd; in main() local
86 ttyfd = -1; in main()
93 ttyfd = search_utmp(argv[1], mytty, myuid, saved_egid); in main()
103 ttyfd = term_chk(uid, argv[2], &msgsok, &atime, 0, saved_egid); in main()
104 if (ttyfd == -1) in main()
116 do_write(ttyfd, mytty, myuid); in main()
216 do_write(int ttyfd, const char *mytty, const uid_t myuid) in do_write() argument
231 if (dup2(ttyfd, STDOUT_FILENO) == -1) in do_write()
236 (void)close(ttyfd); in do_write()
/netbsd/src/bin/pax/
Dtty_subs.c81 int ttyfd; in tty_init() local
83 if ((ttyfd = open(DEVTTY, O_RDWR)) >= 0) { in tty_init()
84 if ((ttyoutf = fdopen(ttyfd, "w")) != NULL) { in tty_init()
85 if ((ttyinf = fdopen(ttyfd, "r")) != NULL) in tty_init()
89 (void)close(ttyfd); in tty_init()
/netbsd/src/usr.bin/find/
Dmisc.c140 static int ttyfd = -2; in show_path() local
153 if (ttyfd == -2) in show_path()
154 ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC); in show_path()
156 if (ttyfd == -1) in show_path()
165 write(ttyfd, buf, (size_t)n); in show_path()
/netbsd/src/external/bsd/ppp/dist/pppd/
Dtty.c130 static int ttyfd; /* Serial port file descriptor */ variable
639 ttyfd = real_ttyfd; in connect_tty()
640 if ((fdflags = fcntl(ttyfd, F_GETFL)) == -1 in connect_tty()
641 || fcntl(ttyfd, F_SETFL, fdflags & ~O_NONBLOCK) < 0) in connect_tty()
652 if (fstat(ttyfd, &statbuf) < 0 in connect_tty()
653 || fchmod(ttyfd, statbuf.st_mode & ~(S_IWGRP | S_IWOTH)) < 0) { in connect_tty()
669 set_up_tty(ttyfd, ((connector != NULL && connector[0] != 0) in connect_tty()
718 int fd = dup(ttyfd); in connect_tty()
724 ttyfd = pty_slave; in connect_tty()
741 if (device_script(initializer, ttyfd, ttyfd, 0) < 0) { in connect_tty()
[all …]
/netbsd/src/external/bsd/ntp/dist/ntpd/
Dntp_ppsdev.c386 int ttyfd , /* current tty FD, or -1 */ in ppsdev_reopen() argument
416 if ((-1 == retfd) && (-1 != ttyfd)) { in ppsdev_reopen()
417 char *xpath = findMatchingPpsDev(ttyfd); in ppsdev_reopen()
436 retfd = ttyfd; in ppsdev_reopen()
441 if ((retfd != ttyfd) && (retfd != ppsfd)) in ppsdev_reopen()
442 ppsdev_close(ttyfd, ppsfd); in ppsdev_reopen()
449 int ttyfd, /* current tty FD, or -1 */ in ppsdev_close() argument
455 if ((-1 != ppsfd) && (ttyfd != ppsfd)) in ppsdev_close()
Drefclock_oncore.c275 int ttyfd; /* TTY file descriptor */ member
723 instance->ttyfd = fd1; in oncore_start()
795 close(instance->ttyfd); in oncore_shutdown()
797 if ((instance->ppsfd != -1) && (instance->ppsfd != instance->ttyfd)) in oncore_shutdown()
3545 refclock_fdwrite(instance->peer, instance->ttyfd, in oncore_load_almanac()
3561 write(instance->ttyfd, cp, n); in oncore_load_almanac()
3771 fd = instance->ttyfd; in oncore_sendmsg()
/netbsd/src/crypto/external/bsd/openssh/dist/
Dsession.c541 int fdout, ptyfd, ttyfd, ptymaster; in do_exec_pty() local
547 ttyfd = s->ttyfd; in do_exec_pty()
558 close(ttyfd); in do_exec_pty()
565 close(ttyfd); in do_exec_pty()
577 close(ttyfd); in do_exec_pty()
590 pty_make_controlling_tty(&ttyfd, s->tty); in do_exec_pty()
593 if (dup2(ttyfd, 0) == -1) in do_exec_pty()
595 if (dup2(ttyfd, 1) == -1) in do_exec_pty()
597 if (dup2(ttyfd, 2) == -1) in do_exec_pty()
601 close(ttyfd); in do_exec_pty()
[all …]
Dsshpty.c48 pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) in pty_allocate() argument
53 i = openpty(ptyfd, ttyfd, buf, NULL, NULL); in pty_allocate()
76 pty_make_controlling_tty(int *ttyfd, const char *tty) in pty_make_controlling_tty() argument
103 if (ioctl(*ttyfd, TIOCSCTTY, NULL) == -1) in pty_make_controlling_tty()
Dreadpass.c127 int rppflags, ttyfd, use_askpass = 0, allow_askpass = 0; in read_passphrase() local
156 ttyfd = open(_PATH_TTY, O_RDWR); in read_passphrase()
157 if (ttyfd >= 0) { in read_passphrase()
164 (void)write(ttyfd, &cr, 1); in read_passphrase()
165 close(ttyfd); in read_passphrase()
Dsession.h45 int ptyfd, ttyfd, ptymaster; member
Dmonitor.c1677 if (s->ttyfd != -1) { in mm_session_close()
1700 res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); in mm_answer_pty()
1710 if (dup2(s->ttyfd, 0) == -1) in mm_answer_pty()
1726 mm_send_fd(sock, s->ttyfd) == -1) in mm_answer_pty()
1736 close(s->ttyfd); in mm_answer_pty()
1737 s->ttyfd = s->ptyfd; in mm_answer_pty()
1741 debug3_f("tty %s ptyfd %d", s->tty, s->ttyfd); in mm_answer_pty()
Dmonitor_wrap.c613 mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) in mm_pty_allocate() argument
658 (*ttyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1) in mm_pty_allocate()
671 if (s->ttyfd == -1) in mm_session_pty_cleanup2()
686 s->ttyfd = -1; in mm_session_pty_cleanup2()
/netbsd/src/usr.bin/patch/
Dutil.c263 static int ttyfd = -1; in ask() local
269 if (ttyfd < 0) in ask()
270 ttyfd = open(_PATH_TTY, O_RDONLY); in ask()
271 if (ttyfd >= 0) { in ask()
272 if ((nr = read(ttyfd, buf, bufsz)) > 0 && in ask()
276 if (ttyfd < 0 || nr <= 0) { in ask()
/netbsd/src/bin/sh/
Djobs.c103 static int ttyfd = -1; variable
149 if (ttyfd == from) in ttyfd_change()
150 ttyfd = to; in ttyfd_change()
176 if (ttyfd != -1) in setjobctl()
177 sh_close(ttyfd); in setjobctl()
178 if ((ttyfd = open("/dev/tty", O_RDWR)) == -1) { in setjobctl()
180 if (isatty(i) && (ttyfd = dup(i)) != -1) in setjobctl()
186 ttyfd = to_upper_fd(ttyfd); /* Move to a high fd */ in setjobctl()
187 register_sh_fd(ttyfd, ttyfd_change); in setjobctl()
192 if ((initialpgrp = tcgetpgrp(ttyfd)) < 0) { in setjobctl()
[all …]
/netbsd/src/sbin/scan_ffs/
Dscan_ffs.c399 static int ttyfd = -2; in show_status() local
405 if (ttyfd == -2) in show_status()
406 ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC); in show_status()
408 if (ttyfd == -1) in show_status()
416 write(ttyfd, buf, (size_t)n); in show_status()
/netbsd/src/external/bsd/ntp/dist/include/
Dntp_refclock.h265 int ttyfd, int ppsfd, const char *ppspath,
267 extern void ppsdev_close(int ttyfd, int ppsfd);
/netbsd/src/external/gpl2/xcvs/dist/src/
Dmain.c510 static int ttyfd = -2; in show_status() local
512 if (ttyfd == -2) in show_status()
513 ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC); in show_status()
515 if (ttyfd == -1) in show_status()
524 write(ttyfd, buf, (size_t)n); in show_status()
/netbsd/src/bin/rcp/
Drcp.c828 static int ttyfd = -2; in progress() local
833 if (ttyfd == -2) in progress()
834 ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC); in progress()
836 if (ttyfd == -1) in progress()
846 write(ttyfd, buf, (size_t)n); in progress()
/netbsd/src/external/bsd/ppp/usr.sbin/pppd/
Dsys-bsd.c202 static int ttyfd = -1; /* the file descriptor of the tty */ variable
406 ttyfd = fd; in tty_establish_ppp()
1056 if (write(ttyfd, p, len) < 0) { in output()
1148 if ((len = read(ttyfd, buf, PPP_MTU + PPP_HDRLEN)) < 0) { in read_packet()
1285 if (ioctl(ttyfd, PPPIOCSCOMPRESS, (caddr_t) &data) >= 0) in ccp_test()
/netbsd/src/usr.bin/gzip/
Dgzip.c1730 static int ttyfd = -2; in check_siginfo() local
1740 if (ttyfd == -2) in check_siginfo()
1741 ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC); in check_siginfo()
1743 if (ttyfd == -1) in check_siginfo()
1761 write(ttyfd, buf, (size_t)n); in check_siginfo()