Deleted Added
full compact
tty.c (154018) tty.c (154170)
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 154018 2006-01-04 09:59:07Z phk $");
74__FBSDID("$FreeBSD: head/sys/kern/tty.c 154170 2006-01-10 09:19:10Z 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
87#if defined(COMPAT_43)
86#if defined(COMPAT_43TTY)
88#include <sys/ioctl_compat.h>
89#endif
87#include <sys/ioctl_compat.h>
88#endif
90#endif
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>

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

823 case TIOCSETAW:
824 case TIOCSETD:
825 case TIOCSPGRP:
826 case TIOCSTART:
827 case TIOCSTAT:
828 case TIOCSTI:
829 case TIOCSTOP:
830 case TIOCSWINSZ:
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>

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

821 case TIOCSETAW:
822 case TIOCSETD:
823 case TIOCSPGRP:
824 case TIOCSTART:
825 case TIOCSTAT:
826 case TIOCSTI:
827 case TIOCSTOP:
828 case TIOCSWINSZ:
831#ifndef BURN_BRIDGES
832#if defined(COMPAT_43)
829#if defined(COMPAT_43TTY)
833 case TIOCLBIC:
834 case TIOCLBIS:
835 case TIOCLSET:
836 case TIOCSETC:
837 case OTIOCSETD:
838 case TIOCSETN:
839 case TIOCSETP:
840 case TIOCSLTC:
841#endif
830 case TIOCLBIC:
831 case TIOCLBIS:
832 case TIOCLSET:
833 case TIOCSETC:
834 case OTIOCSETD:
835 case TIOCSETN:
836 case TIOCSETP:
837 case TIOCSLTC:
838#endif
842#endif
843 sx_slock(&proctree_lock);
844 PROC_LOCK(p);
845 while (isbackground(p, tp) && !(p->p_flag & P_PPWAIT) &&
846 !SIGISMEMBER(p->p_sigacts->ps_sigignore, SIGTTOU) &&
847 !SIGISMEMBER(td->td_sigmask, SIGTTOU)) {
848 pgrp = p->p_pgrp;
849 PROC_UNLOCK(p);
850 if (pgrp->pg_jobc == 0) {

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

1250 case TIOCGDRAINWAIT:
1251 *(int *)data = tp->t_timeout / hz;
1252 break;
1253 case TIOCSBRK:
1254 return (tt_break(tp, 1));
1255 case TIOCCBRK:
1256 return (tt_break(tp, 0));
1257 default:
839 sx_slock(&proctree_lock);
840 PROC_LOCK(p);
841 while (isbackground(p, tp) && !(p->p_flag & P_PPWAIT) &&
842 !SIGISMEMBER(p->p_sigacts->ps_sigignore, SIGTTOU) &&
843 !SIGISMEMBER(td->td_sigmask, SIGTTOU)) {
844 pgrp = p->p_pgrp;
845 PROC_UNLOCK(p);
846 if (pgrp->pg_jobc == 0) {

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

1246 case TIOCGDRAINWAIT:
1247 *(int *)data = tp->t_timeout / hz;
1248 break;
1249 case TIOCSBRK:
1250 return (tt_break(tp, 1));
1251 case TIOCCBRK:
1252 return (tt_break(tp, 0));
1253 default:
1258#if defined(COMPAT_43)
1259#ifndef BURN_BRIDGES
1254#if defined(COMPAT_43TTY)
1260 return (ttcompat(tp, cmd, data, flag));
1261#else
1262 return (ENOIOCTL);
1263#endif
1255 return (ttcompat(tp, cmd, data, flag));
1256#else
1257 return (ENOIOCTL);
1258#endif
1264#else
1265 return (ENOIOCTL);
1266#endif
1267 }
1268 return (0);
1269}
1270
1271int
1272ttypoll(struct cdev *dev, int events, struct thread *td)
1273{
1274 int s;

--- 2134 unchanged lines hidden ---
1259 }
1260 return (0);
1261}
1262
1263int
1264ttypoll(struct cdev *dev, int events, struct thread *td)
1265{
1266 int s;

--- 2134 unchanged lines hidden ---