Deleted Added
full compact
pty.c (130640) pty.c (130892)
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>
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 130640 2004-06-17 17:16:53Z phk $");
33__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 130892 2004-06-21 22:57:16Z 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>
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
46#if defined(COMPAT_43)
47#include <sys/ioctl_compat.h>
48#endif
47#if defined(COMPAT_43)
48#include <sys/ioctl_compat.h>
49#endif
50#endif
49#include <sys/proc.h>
50#include <sys/tty.h>
51#include <sys/conf.h>
52#include <sys/fcntl.h>
53#include <sys/poll.h>
54#include <sys/kernel.h>
55#include <sys/vnode.h>
56#include <sys/signalvar.h>

--- 597 unchanged lines hidden (view full) ---

654 /*
655 * The rest of the ioctls shouldn't be called until
656 * the slave is open.
657 */
658 if ((tp->t_state & TS_ISOPEN) == 0)
659 return (EAGAIN);
660
661 switch (cmd) {
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/vnode.h>
58#include <sys/signalvar.h>

--- 597 unchanged lines hidden (view full) ---

656 /*
657 * The rest of the ioctls shouldn't be called until
658 * the slave is open.
659 */
660 if ((tp->t_state & TS_ISOPEN) == 0)
661 return (EAGAIN);
662
663 switch (cmd) {
664#ifndef BURN_BRIDGES
662#ifdef COMPAT_43
663 case TIOCSETP:
664 case TIOCSETN:
665#endif
665#ifdef COMPAT_43
666 case TIOCSETP:
667 case TIOCSETN:
668#endif
669#endif
666 case TIOCSETD:
667 case TIOCSETA:
668 case TIOCSETAW:
669 case TIOCSETAF:
670 /*
671 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
672 * ttywflush(tp) will hang if there are characters in
673 * the outq.

--- 55 unchanged lines hidden (view full) ---

729 /*
730 * If external processing and packet mode send ioctl packet.
731 */
732 if ((tp->t_lflag&EXTPROC) && (pt->pt_flags & PF_PKT)) {
733 switch(cmd) {
734 case TIOCSETA:
735 case TIOCSETAW:
736 case TIOCSETAF:
670 case TIOCSETD:
671 case TIOCSETA:
672 case TIOCSETAW:
673 case TIOCSETAF:
674 /*
675 * IF CONTROLLER STTY THEN MUST FLUSH TO PREVENT A HANG.
676 * ttywflush(tp) will hang if there are characters in
677 * the outq.

--- 55 unchanged lines hidden (view full) ---

733 /*
734 * If external processing and packet mode send ioctl packet.
735 */
736 if ((tp->t_lflag&EXTPROC) && (pt->pt_flags & PF_PKT)) {
737 switch(cmd) {
738 case TIOCSETA:
739 case TIOCSETAW:
740 case TIOCSETAF:
741#ifndef BURN_BRIDGES
737#ifdef COMPAT_43
738 case TIOCSETP:
739 case TIOCSETN:
742#ifdef COMPAT_43
743 case TIOCSETP:
744 case TIOCSETN:
740#endif
741#if defined(COMPAT_43)
742 case TIOCSETC:
743 case TIOCSLTC:
744 case TIOCLBIS:
745 case TIOCLBIC:
746 case TIOCLSET:
747#endif
745 case TIOCSETC:
746 case TIOCSLTC:
747 case TIOCLBIS:
748 case TIOCLBIC:
749 case TIOCLSET:
750#endif
751#endif
748 pt->pt_send |= TIOCPKT_IOCTL;
749 ptcwakeup(tp, FREAD);
750 break;
751 default:
752 break;
753 }
754 }
755 stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s'))

--- 61 unchanged lines hidden ---
752 pt->pt_send |= TIOCPKT_IOCTL;
753 ptcwakeup(tp, FREAD);
754 break;
755 default:
756 break;
757 }
758 }
759 stop = (tp->t_iflag & IXON) && CCEQ(cc[VSTOP], CTRL('s'))

--- 61 unchanged lines hidden ---