1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 16 unchanged lines hidden (view full) ---
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 154015 2006-01-04 09:09:46Z phk $");
34
35/*
36 * Pseudo-teletype Driver
37 * (Actually two drivers, requiring two entries in 'cdevsw')
38 */
39#include "opt_compat.h"
40#include "opt_tty.h"
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/lock.h>
44#include <sys/mutex.h>
45#include <sys/sx.h>
46#ifndef BURN_BRIDGES
47#if defined(COMPAT_43)
48#include <sys/ioctl_compat.h>
49#endif
50#endif
51#include <sys/proc.h>
52#include <sys/tty.h>
53#include <sys/conf.h>
54#include <sys/fcntl.h>
55#include <sys/poll.h>
56#include <sys/kernel.h>
57#include <sys/uio.h>
58#include <sys/signalvar.h>
--- 489 unchanged lines hidden (view full) ---
548 /*
549 * The rest of the ioctls shouldn't be called until
550 * the slave is open.
551 */
552 if ((tp->t_state & TS_ISOPEN) == 0)
553 return (EAGAIN);
554
555 switch (cmd) {
556#ifndef BURN_BRIDGES
557#ifdef COMPAT_43
558 case TIOCSETP:
559 case TIOCSETN:
560#endif
561#endif
562 case TIOCSETD:
563 case TIOCSETA:
564 case TIOCSETAW:
565 case TIOCSETAF:
566 /*
567 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
568 * ttywflush(tp) will hang if there are characters in
569 * the outq.
--- 67 unchanged lines hidden (view full) ---
637 /*
638 * If external processing and packet mode send ioctl packet.
639 */
640 if ((tp->t_lflag&EXTPROC) && (pt->pt_flags & PF_PKT)) {
641 switch(cmd) {
642 case TIOCSETA:
643 case TIOCSETAW:
644 case TIOCSETAF:
645#ifndef BURN_BRIDGES
646#ifdef COMPAT_43
647 case TIOCSETP:
648 case TIOCSETN:
649 case TIOCSETC:
650 case TIOCSLTC:
651 case TIOCLBIS:
652 case TIOCLBIC:
653 case TIOCLSET:
654#endif
655#endif
656 pt->pt_send |= TIOCPKT_IOCTL;
657 ptcwakeup(tp, FREAD);
658 break;
659 default:
660 break;
661 }
662 }
663 stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s'))
--- 63 unchanged lines hidden ---
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 16 unchanged lines hidden (view full) ---
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 154015 2006-01-04 09:09:46Z phk $");
34
35/*
36 * Pseudo-teletype Driver
37 * (Actually two drivers, requiring two entries in 'cdevsw')
38 */
39#include "opt_compat.h"
40#include "opt_tty.h"
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/lock.h>
44#include <sys/mutex.h>
45#include <sys/sx.h>
46#ifndef BURN_BRIDGES
47#if defined(COMPAT_43)
48#include <sys/ioctl_compat.h>
49#endif
50#endif
51#include <sys/proc.h>
52#include <sys/tty.h>
53#include <sys/conf.h>
54#include <sys/fcntl.h>
55#include <sys/poll.h>
56#include <sys/kernel.h>
57#include <sys/uio.h>
58#include <sys/signalvar.h>
--- 489 unchanged lines hidden (view full) ---
548 /*
549 * The rest of the ioctls shouldn't be called until
550 * the slave is open.
551 */
552 if ((tp->t_state & TS_ISOPEN) == 0)
553 return (EAGAIN);
554
555 switch (cmd) {
556#ifndef BURN_BRIDGES
557#ifdef COMPAT_43
558 case TIOCSETP:
559 case TIOCSETN:
560#endif
561#endif
562 case TIOCSETD:
563 case TIOCSETA:
564 case TIOCSETAW:
565 case TIOCSETAF:
566 /*
567 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
568 * ttywflush(tp) will hang if there are characters in
569 * the outq.
--- 67 unchanged lines hidden (view full) ---
637 /*
638 * If external processing and packet mode send ioctl packet.
639 */
640 if ((tp->t_lflag&EXTPROC) && (pt->pt_flags & PF_PKT)) {
641 switch(cmd) {
642 case TIOCSETA:
643 case TIOCSETAW:
644 case TIOCSETAF:
645#ifndef BURN_BRIDGES
646#ifdef COMPAT_43
647 case TIOCSETP:
648 case TIOCSETN:
649 case TIOCSETC:
650 case TIOCSLTC:
651 case TIOCLBIS:
652 case TIOCLBIC:
653 case TIOCLSET:
654#endif
655#endif
656 pt->pt_send |= TIOCPKT_IOCTL;
657 ptcwakeup(tp, FREAD);
658 break;
659 default:
660 break;
661 }
662 }
663 stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s'))
--- 63 unchanged lines hidden ---