tty.c (94860) | tty.c (95883) |
---|---|
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. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)tty.c 8.8 (Berkeley) 1/21/94 | 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. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)tty.c 8.8 (Berkeley) 1/21/94 |
39 * $FreeBSD: head/sys/kern/tty.c 94860 2002-04-16 17:09:22Z jhb $ | 39 * $FreeBSD: head/sys/kern/tty.c 95883 2002-05-01 20:44:46Z alfred $ |
40 */ 41 42/*- 43 * TODO: 44 * o Fix races for sending the start char in ttyflush(). 45 * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttyselect(). 46 * With luck, there will be MIN chars before select() returns(). 47 * o Handle CLOCAL consistently for ptys. Perhaps disallow setting it. --- 2236 unchanged lines hidden (view full) --- 2284void 2285ttwakeup(tp) 2286 register struct tty *tp; 2287{ 2288 2289 if (SEL_WAITING(&tp->t_rsel)) 2290 selwakeup(&tp->t_rsel); 2291 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) | 40 */ 41 42/*- 43 * TODO: 44 * o Fix races for sending the start char in ttyflush(). 45 * o Handle inter-byte timeout for "MIN > 0, TIME > 0" in ttyselect(). 46 * With luck, there will be MIN chars before select() returns(). 47 * o Handle CLOCAL consistently for ptys. Perhaps disallow setting it. --- 2236 unchanged lines hidden (view full) --- 2284void 2285ttwakeup(tp) 2286 register struct tty *tp; 2287{ 2288 2289 if (SEL_WAITING(&tp->t_rsel)) 2290 selwakeup(&tp->t_rsel); 2291 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) |
2292 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL)); | 2292 pgsigio(&tp->t_sigio, SIGIO, (tp->t_session != NULL)); |
2293 wakeup(TSA_HUP_OR_INPUT(tp)); 2294 KNOTE(&tp->t_rsel.si_note, 0); 2295} 2296 2297/* 2298 * Wake up any writers on a tty. 2299 */ 2300void 2301ttwwakeup(tp) 2302 register struct tty *tp; 2303{ 2304 2305 if (SEL_WAITING(&tp->t_wsel) && tp->t_outq.c_cc <= tp->t_olowat) 2306 selwakeup(&tp->t_wsel); 2307 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) | 2293 wakeup(TSA_HUP_OR_INPUT(tp)); 2294 KNOTE(&tp->t_rsel.si_note, 0); 2295} 2296 2297/* 2298 * Wake up any writers on a tty. 2299 */ 2300void 2301ttwwakeup(tp) 2302 register struct tty *tp; 2303{ 2304 2305 if (SEL_WAITING(&tp->t_wsel) && tp->t_outq.c_cc <= tp->t_olowat) 2306 selwakeup(&tp->t_wsel); 2307 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL) |
2308 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL)); | 2308 pgsigio(&tp->t_sigio, SIGIO, (tp->t_session != NULL)); |
2309 if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) == 2310 TS_SO_OCOMPLETE && tp->t_outq.c_cc == 0) { 2311 CLR(tp->t_state, TS_SO_OCOMPLETE); 2312 wakeup(TSA_OCOMPLETE(tp)); 2313 } 2314 if (ISSET(tp->t_state, TS_SO_OLOWAT) && 2315 tp->t_outq.c_cc <= tp->t_olowat) { 2316 CLR(tp->t_state, TS_SO_OLOWAT); --- 380 unchanged lines hidden --- | 2309 if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) == 2310 TS_SO_OCOMPLETE && tp->t_outq.c_cc == 0) { 2311 CLR(tp->t_state, TS_SO_OCOMPLETE); 2312 wakeup(TSA_OCOMPLETE(tp)); 2313 } 2314 if (ISSET(tp->t_state, TS_SO_OLOWAT) && 2315 tp->t_outq.c_cc <= tp->t_olowat) { 2316 CLR(tp->t_state, TS_SO_OLOWAT); --- 380 unchanged lines hidden --- |