5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright (c) 2018, Joyent, Inc.
25 * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
26 */
27
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30
31 /*
32 * University Copyright- Copyright (c) 1982, 1986, 1988
33 * The Regents of the University of California
34 * All Rights Reserved
35 *
36 * University Acknowledgment- Portions of this document are derived from
37 * software developed by the University of California, Berkeley, and its
38 * contributors.
39 */
40
41 /*
42 * Standard Streams Terminal Line Discipline module.
43 */
44
45 #include <sys/param.h>
4070 * routine to prevent flushing our
4071 * own data. Note that downstream
4072 * modules on the write side will be
4073 * flushed by the M_FLUSH sent above.
4074 */
4075 tp->t_state |= TS_FLUSHWAIT;
4076 (void) putnextctl1(q, M_FLUSH, FLUSHW);
4077 if (tp->t_state & TS_TTSTOP) {
4078 (void) putnextctl(WR(q), M_START);
4079 tp->t_state &= ~(TS_TTSTOP|TS_OFBLOCK);
4080 }
4081 }
4082 }
4083 }
4084 tp->t_state &= ~TS_QUOT;
4085 if (sndsig == 0)
4086 (void) putnextctl1(q, mtype, sig);
4087
4088 if (c != '\0') {
4089 if ((tp->t_echomp = allocb(4, BPRI_HI)) != NULL) {
4090 if (ldterm_echo(c, WR(q), 4, tp) > 0)
4091 putnext(WR(q), tp->t_echomp);
4092 else
4093 freemsg(tp->t_echomp);
4094 tp->t_echomp = NULL;
4095 }
4096 }
4097 }
4098
4099
4100 /*
4101 * Called when an M_IOCTL message is seen on the write queue; does
4102 * whatever we're supposed to do with it, and either replies
4103 * immediately or passes it to the next module down.
4104 */
4105 static void
4106 ldterm_do_ioctl(queue_t *q, mblk_t *mp)
4107 {
4108 ldtermstd_state_t *tp;
4109 struct iocblk *iocp;
4110 struct eucioc *euciocp; /* needed for EUC ioctls */
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright (c) 2018, Joyent, Inc.
25 * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
26 */
27
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
30
31 /*
32 * University Copyright- Copyright (c) 1982, 1986, 1988
33 * The Regents of the University of California
34 * All Rights Reserved
35 *
36 * University Acknowledgment- Portions of this document are derived from
37 * software developed by the University of California, Berkeley, and its
38 * contributors.
39 */
40
41 /*
42 * Standard Streams Terminal Line Discipline module.
43 */
44
45 #include <sys/param.h>
4070 * routine to prevent flushing our
4071 * own data. Note that downstream
4072 * modules on the write side will be
4073 * flushed by the M_FLUSH sent above.
4074 */
4075 tp->t_state |= TS_FLUSHWAIT;
4076 (void) putnextctl1(q, M_FLUSH, FLUSHW);
4077 if (tp->t_state & TS_TTSTOP) {
4078 (void) putnextctl(WR(q), M_START);
4079 tp->t_state &= ~(TS_TTSTOP|TS_OFBLOCK);
4080 }
4081 }
4082 }
4083 }
4084 tp->t_state &= ~TS_QUOT;
4085 if (sndsig == 0)
4086 (void) putnextctl1(q, mtype, sig);
4087
4088 if (c != '\0') {
4089 if ((tp->t_echomp = allocb(4, BPRI_HI)) != NULL) {
4090 if (ldterm_echo(c, WR(q), 4, tp) > 0 ||
4091 (tp->t_state & TS_ISPTSTTY))
4092 putnext(WR(q), tp->t_echomp);
4093 else
4094 freemsg(tp->t_echomp);
4095 tp->t_echomp = NULL;
4096 }
4097 }
4098 }
4099
4100
4101 /*
4102 * Called when an M_IOCTL message is seen on the write queue; does
4103 * whatever we're supposed to do with it, and either replies
4104 * immediately or passes it to the next module down.
4105 */
4106 static void
4107 ldterm_do_ioctl(queue_t *q, mblk_t *mp)
4108 {
4109 ldtermstd_state_t *tp;
4110 struct iocblk *iocp;
4111 struct eucioc *euciocp; /* needed for EUC ioctls */
|