Deleted Added
full compact
tty.c (92069) tty.c (92252)
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 92069 2002-03-11 07:53:13Z tanimura $
39 * $FreeBSD: head/sys/kern/tty.c 92252 2002-03-14 01:32:30Z 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.

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

2268/*
2269 * Wake up any readers on a tty.
2270 */
2271void
2272ttwakeup(tp)
2273 register struct tty *tp;
2274{
2275
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.

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

2268/*
2269 * Wake up any readers on a tty.
2270 */
2271void
2272ttwakeup(tp)
2273 register struct tty *tp;
2274{
2275
2276 if (tp->t_rsel.si_pid != 0)
2276 if (SEL_WAITING(&tp->t_rsel))
2277 selwakeup(&tp->t_rsel);
2278 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
2279 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
2280 wakeup(TSA_HUP_OR_INPUT(tp));
2281 KNOTE(&tp->t_rsel.si_note, 0);
2282}
2283
2284/*
2285 * Wake up any writers on a tty.
2286 */
2287void
2288ttwwakeup(tp)
2289 register struct tty *tp;
2290{
2291
2277 selwakeup(&tp->t_rsel);
2278 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
2279 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
2280 wakeup(TSA_HUP_OR_INPUT(tp));
2281 KNOTE(&tp->t_rsel.si_note, 0);
2282}
2283
2284/*
2285 * Wake up any writers on a tty.
2286 */
2287void
2288ttwwakeup(tp)
2289 register struct tty *tp;
2290{
2291
2292 if (tp->t_wsel.si_pid != 0 && tp->t_outq.c_cc <= tp->t_olowat)
2292 if (SEL_WAITING(&tp->t_wsel) && tp->t_outq.c_cc <= tp->t_olowat)
2293 selwakeup(&tp->t_wsel);
2294 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
2295 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
2296 if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) ==
2297 TS_SO_OCOMPLETE && tp->t_outq.c_cc == 0) {
2298 CLR(tp->t_state, TS_SO_OCOMPLETE);
2299 wakeup(TSA_OCOMPLETE(tp));
2300 }

--- 383 unchanged lines hidden ---
2293 selwakeup(&tp->t_wsel);
2294 if (ISSET(tp->t_state, TS_ASYNC) && tp->t_sigio != NULL)
2295 pgsigio(tp->t_sigio, SIGIO, (tp->t_session != NULL));
2296 if (ISSET(tp->t_state, TS_BUSY | TS_SO_OCOMPLETE) ==
2297 TS_SO_OCOMPLETE && tp->t_outq.c_cc == 0) {
2298 CLR(tp->t_state, TS_SO_OCOMPLETE);
2299 wakeup(TSA_OCOMPLETE(tp));
2300 }

--- 383 unchanged lines hidden ---