Home
last modified time | relevance | path

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

/dragonfly/bin/notty/
HDnotty.c62 int ttyfd; in main() local
76 ttyfd = open("/dev/null", O_RDWR); in main()
78 if (strchr(opts, '0') == NULL && ttyfd != 0) in main()
79 dup2(ttyfd, 0); in main()
80 if (strchr(opts, '1') == NULL && ttyfd != 1) in main()
81 dup2(ttyfd, 1); in main()
82 if (strchr(opts, '2') == NULL && ttyfd != 2) in main()
83 dup2(ttyfd, 2); in main()
85 if (ttyfd > 2) in main()
86 close(ttyfd); in main()
/dragonfly/bin/pax/
HDtty_subs.c66 int ttyfd; in tty_init() local
68 if ((ttyfd = open(DEVTTY, O_RDWR)) >= 0) { in tty_init()
69 if ((ttyoutf = fdopen(ttyfd, "w")) != NULL) { in tty_init()
70 if ((ttyinf = fdopen(ttyfd, "r")) != NULL) in tty_init()
74 close(ttyfd); in tty_init()
/dragonfly/bin/sh/
HDjobs.c124 static int ttyfd = -1; variable
163 if (ttyfd >= 0) { in jobctl_notty()
164 close(ttyfd); in jobctl_notty()
165 ttyfd = -1; in jobctl_notty()
186 if (ttyfd != -1) in setjobctl()
187 close(ttyfd); in setjobctl()
188 if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC_MAYBE)) < 0) { in setjobctl()
193 (ttyfd = fcntl(i, F_DUPFD_CLOEXEC_MAYBE, 10)) < 0) { in setjobctl()
198 if (ttyfd < 10) { in setjobctl()
203 if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC_MAYBE, 10)) < 0) { in setjobctl()
[all …]
/dragonfly/sbin/hammer2/
HDcmd_service.c1009 int ttyfd; in hammer2_demon() local
1038 ttyfd = open("/dev/null", O_RDWR); in hammer2_demon()
1039 if (ttyfd >= 0) { in hammer2_demon()
1040 if (ttyfd != 0) in hammer2_demon()
1041 dup2(ttyfd, 0); in hammer2_demon()
1042 if (ttyfd != 1) in hammer2_demon()
1043 dup2(ttyfd, 1); in hammer2_demon()
1044 if (ttyfd != 2) in hammer2_demon()
1045 dup2(ttyfd, 2); in hammer2_demon()
1046 if (ttyfd > 2) in hammer2_demon()
[all …]
/dragonfly/test/stress/stress2/misc/
HDrevoke.sh73 int ttyfd;
100 ttyfd = open(argv[1], O_RDWR);
101 if (ttyfd < 0) {
105 if (ioctl(ttyfd, TIOCSCTTY) < 0) {
/dragonfly/crypto/openssh/
HDsshpty.c65 pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) in pty_allocate() argument
71 i = openpty(ptyfd, ttyfd, NULL, NULL, NULL); in pty_allocate()
76 name = ttyname(*ttyfd); in pty_allocate()
100 pty_make_controlling_tty(int *ttyfd, const char *tty) in pty_make_controlling_tty() argument
127 if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0) in pty_make_controlling_tty()
HDsession.c570 int fdout, ptyfd, ttyfd, ptymaster; in do_exec_pty() local
576 ttyfd = s->ttyfd; in do_exec_pty()
587 close(ttyfd); in do_exec_pty()
594 close(ttyfd); in do_exec_pty()
606 close(ttyfd); in do_exec_pty()
619 pty_make_controlling_tty(&ttyfd, s->tty); in do_exec_pty()
622 if (dup2(ttyfd, 0) == -1) in do_exec_pty()
624 if (dup2(ttyfd, 1) == -1) in do_exec_pty()
626 if (dup2(ttyfd, 2) == -1) in do_exec_pty()
630 close(ttyfd); in do_exec_pty()
[all …]
HDreadpass.c126 int rppflags, ttyfd, use_askpass = 0, allow_askpass = 0; in read_passphrase() local
155 ttyfd = open(_PATH_TTY, O_RDWR); in read_passphrase()
156 if (ttyfd >= 0) { in read_passphrase()
163 (void)write(ttyfd, &cr, 1); in read_passphrase()
164 close(ttyfd); in read_passphrase()
HDsession.h42 int ptyfd, ttyfd, ptymaster; member
HDmonitor.c1554 if (s->ttyfd != -1) { in mm_session_close()
1577 res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); in mm_answer_pty()
1587 if (dup2(s->ttyfd, 0) == -1) in mm_answer_pty()
1603 mm_send_fd(sock, s->ttyfd) == -1) in mm_answer_pty()
1613 close(s->ttyfd); in mm_answer_pty()
1614 s->ttyfd = s->ptyfd; in mm_answer_pty()
1618 debug3_f("tty %s ptyfd %d", s->tty, s->ttyfd); in mm_answer_pty()
HDmonitor_wrap.c624 mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) in mm_pty_allocate() argument
668 (*ttyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1) in mm_pty_allocate()
681 if (s->ttyfd == -1) in mm_session_pty_cleanup2()
696 s->ttyfd = -1; in mm_session_pty_cleanup2()
HDconfigure.ac2436 int fd, ptyfd, ttyfd, status;
2450 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
HDconfigure18024 int fd, ptyfd, ttyfd, status;
18038 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
/dragonfly/usr.bin/patch/
HDutil.c274 static int ttyfd = -1; in ask() local
280 if (ttyfd < 0) in ask()
281 ttyfd = open(_PATH_TTY, O_RDONLY); in ask()
282 if (ttyfd >= 0) { in ask()
283 if ((nr = read(ttyfd, buf, buf_size)) > 0 && in ask()
287 if (ttyfd < 0 || nr <= 0) { in ask()