Deleted Added
full compact
tty.c (130585) tty.c (130892)
1/*-
2 * Copyright (c) 1982, 1986, 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

66 * o Check for TS_CARR_ON being set while everything is closed and not
67 * waiting for carrier. TS_CARR_ON isn't cleared if nothing is open,
68 * so it would live until the next open even if carrier drops.
69 * o Restore TS_WOPEN since it is useful in pstat. It must be cleared
70 * only when _all_ openers leave open().
71 */
72
73#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

66 * o Check for TS_CARR_ON being set while everything is closed and not
67 * waiting for carrier. TS_CARR_ON isn't cleared if nothing is open,
68 * so it would live until the next open even if carrier drops.
69 * o Restore TS_WOPEN since it is useful in pstat. It must be cleared
70 * only when _all_ openers leave open().
71 */
72
73#include <sys/cdefs.h>
74__FBSDID("$FreeBSD: head/sys/kern/tty.c 130585 2004-06-16 09:47:26Z phk $");
74__FBSDID("$FreeBSD: head/sys/kern/tty.c 130892 2004-06-21 22:57:16Z phk $");
75
76#include "opt_compat.h"
77#include "opt_tty.h"
78
79#include <sys/param.h>
80#include <sys/systm.h>
81#include <sys/filio.h>
82#include <sys/lock.h>
83#include <sys/mutex.h>
84#include <sys/namei.h>
85#include <sys/sx.h>
75
76#include "opt_compat.h"
77#include "opt_tty.h"
78
79#include <sys/param.h>
80#include <sys/systm.h>
81#include <sys/filio.h>
82#include <sys/lock.h>
83#include <sys/mutex.h>
84#include <sys/namei.h>
85#include <sys/sx.h>
86#ifndef BURN_BRIDGES
86#if defined(COMPAT_43)
87#include <sys/ioctl_compat.h>
88#endif
87#if defined(COMPAT_43)
88#include <sys/ioctl_compat.h>
89#endif
90#endif
89#include <sys/proc.h>
90#define TTYDEFCHARS
91#include <sys/tty.h>
92#undef TTYDEFCHARS
93#include <sys/fcntl.h>
94#include <sys/conf.h>
95#include <sys/poll.h>
96#include <sys/kernel.h>

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

764 case TIOCSETAW:
765 case TIOCSETD:
766 case TIOCSPGRP:
767 case TIOCSTART:
768 case TIOCSTAT:
769 case TIOCSTI:
770 case TIOCSTOP:
771 case TIOCSWINSZ:
91#include <sys/proc.h>
92#define TTYDEFCHARS
93#include <sys/tty.h>
94#undef TTYDEFCHARS
95#include <sys/fcntl.h>
96#include <sys/conf.h>
97#include <sys/poll.h>
98#include <sys/kernel.h>

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

766 case TIOCSETAW:
767 case TIOCSETD:
768 case TIOCSPGRP:
769 case TIOCSTART:
770 case TIOCSTAT:
771 case TIOCSTI:
772 case TIOCSTOP:
773 case TIOCSWINSZ:
774#ifndef BURN_BRIDGES
772#if defined(COMPAT_43)
773 case TIOCLBIC:
774 case TIOCLBIS:
775 case TIOCLSET:
776 case TIOCSETC:
777 case OTIOCSETD:
778 case TIOCSETN:
779 case TIOCSETP:
780 case TIOCSLTC:
781#endif
775#if defined(COMPAT_43)
776 case TIOCLBIC:
777 case TIOCLBIS:
778 case TIOCLSET:
779 case TIOCSETC:
780 case OTIOCSETD:
781 case TIOCSETN:
782 case TIOCSETP:
783 case TIOCSLTC:
784#endif
785#endif
782 sx_slock(&proctree_lock);
783 PROC_LOCK(p);
784 while (isbackground(p, tp) && !(p->p_flag & P_PPWAIT) &&
785 !SIGISMEMBER(p->p_sigacts->ps_sigignore, SIGTTOU) &&
786 !SIGISMEMBER(td->td_sigmask, SIGTTOU)) {
787 pgrp = p->p_pgrp;
788 PROC_UNLOCK(p);
789 if (pgrp->pg_jobc == 0) {

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

1126 wakeup(TSA_OCOMPLETE(tp));
1127 wakeup(TSA_OLOWAT(tp));
1128 break;
1129 case TIOCGDRAINWAIT:
1130 *(int *)data = tp->t_timeout / hz;
1131 break;
1132 default:
1133#if defined(COMPAT_43)
786 sx_slock(&proctree_lock);
787 PROC_LOCK(p);
788 while (isbackground(p, tp) && !(p->p_flag & P_PPWAIT) &&
789 !SIGISMEMBER(p->p_sigacts->ps_sigignore, SIGTTOU) &&
790 !SIGISMEMBER(td->td_sigmask, SIGTTOU)) {
791 pgrp = p->p_pgrp;
792 PROC_UNLOCK(p);
793 if (pgrp->pg_jobc == 0) {

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

1130 wakeup(TSA_OCOMPLETE(tp));
1131 wakeup(TSA_OLOWAT(tp));
1132 break;
1133 case TIOCGDRAINWAIT:
1134 *(int *)data = tp->t_timeout / hz;
1135 break;
1136 default:
1137#if defined(COMPAT_43)
1138#ifndef BURN_BRIDGES
1134 return (ttcompat(tp, cmd, data, flag));
1135#else
1136 return (ENOIOCTL);
1137#endif
1139 return (ttcompat(tp, cmd, data, flag));
1140#else
1141 return (ENOIOCTL);
1142#endif
1143#else
1144 return (ENOIOCTL);
1145#endif
1138 }
1139 return (0);
1140}
1141
1142int
1143ttypoll(struct cdev *dev, int events, struct thread *td)
1144{
1145 int s;

--- 1707 unchanged lines hidden ---
1146 }
1147 return (0);
1148}
1149
1150int
1151ttypoll(struct cdev *dev, int events, struct thread *td)
1152{
1153 int s;

--- 1707 unchanged lines hidden ---