1 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
2 .\" Copyright 2019, Joyent, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the
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 .Dd March 17, 2019
19 .Dt TERMIO 7I
20 .Os
21 .Sh NAME
22 .Nm termio
23 .Nd general terminal interface
24 .Sh SYNOPSIS
25 .In termio.h
26 .Fn ioctl "int fildes" "int request" "struct termio *arg"
27 .Fn ioctl "int fildes" "int request" "int arg"
28 .Pp
29 .In termios.h
30 .Fn ioctl "int fildes" "int request" "struct termios *arg"
31 .Sh DESCRIPTION
32 This release supports a general interface for asynchronous communications ports
33 that is hardware-independent.
34 The user interface to this functionality is using
35 function calls (the preferred interface) described in
36 .Xr termios 3C
37 or
38 .Fn ioctl
216 .Sy WERASE
217 will erase beyond the beginning of the line.
218 The
219 .Sy KILL
220 character (by default,
221 the character
222 .Sy NAK )
223 kills (deletes) the entire input line, and optionally
224 outputs a newline character.
225 All these characters operate on a key stroke basis,
226 independent of any backspacing or tabbing that may have been done.
227 The
228 .Sy REPRINT
229 character (the character
230 .Sy Control-r )
231 prints a newline followed by all characters that have not been read.
232 Reprinting also occurs automatically if
233 characters that would normally be erased from the screen are fouled by program
234 output.
235 The characters are reprinted as if they were being echoed;
236 consequencely, if
237 .Dv ECHO
238 is not set, they are not printed.
239 .Pp
240 The
241 .Sy ERASE ,
242 .Sy ERASE2 ,
243 and
244 .Sy KILL
245 characters may be entered literally by preceding them with the escape character.
246 In this case, the escape character is not read.
247 The erase, erase2, and kill characters may be changed.
248 .Ss "Non-canonical Mode Input Processing"
249 In non-canonical mode input processing, input characters are not assembled into
250 lines, and erase and kill processing does not occur.
251 The
252 .Sy MIN
253 and
254 .Sy TIME
255 values are used to determine how to process the characters received.
256 .Pp
390 .Po
391 .Sy MIN
392 = 0,
393 .Sy TIME
394 > 0
395 .Pc ,
396 .Sy TIME
397 represents a read timer.
398 .El
399 .Pp
400 These two points highlight the dual purpose of the
401 .Sy MIN/TIME
402 feature.
403 Cases A and B, where
404 .Sy MIN
405 > 0, exist to handle burst mode activity (for
406 example, file transfer programs), where a program would like to process at
407 least
408 .Sy MIN
409 characters at a time.
410 In case A, the inteercharacter timer is
411 activated by a user as a safety measure; in case B, the timer is turned off.
412 .Pp
413 Cases C and D exist to handle single character, timed transfers.
414 These cases
415 are readily adaptable to screen-based applications that need to know if a
416 character is present in the input queue before refreshing the screen.
417 In case
418 C, the read is timed, whereas in case D, it is not.
419 .Pp
420 Another important note is that
421 .Sy MIN
422 is always just a minimum.
423 It does not
424 denote a record length.
425 For example, if a program does a read of 20 bytes,
426 .Sy MIN
427 is 10, and 25 characters are present, then 20 characters will be
428 returned to the user.
429 .Ss "Writing Characters"
430 When one or more characters are written, they are transmitted to the terminal
431 as soon as previously written characters have finished typing.
432 nputt characters
433 are echoed as they are typed if echoing has been enabled.
434 If a process produces
435 characters more rapidly than they can be typed, it will be suspended when its
436 output queue exceeds some limit.
437 When the queue is drained down to some
438 threshold, the program is resumed.
439 .Ss "Special Characters"
440 Certain characters have special functions on input.
441 These functions and their default character values are summarized as follows:
442 .Bl -tag -width REPRINT
443 .It Sy INTR
444 (Control-c or
445 .Sy ASCII ETX )
446 generates a
447 .Dv SIGINT
448 signal.
449 .Dv SIGINT
450 is sent to all foreground processes associated with the controlling terminal.
451 Normally, each such process is forced to terminate, but arrangements may be
452 made either to ignore the signal or to receive a trap to an agreed upon
673 is closed.
674 .Pp
675 If the controlling process is not in the foreground process group of the
676 terminal, a
677 .Dv SIGTSTP
678 is sent to the terminal's foreground process group.
679 Unless other arrangements have been made, these signals cause the processes to
680 stop.
681 .Pp
682 Processes in background process groups that attempt to access the controlling
683 terminal after modem disconnect while the terminal is still allocated to the
684 session will receive appropriate
685 .Dv SIGTTOU
686 and
687 .Dv SIGTTIN
688 signals.
689 Unless other arrangements have been made, this signal causes the processes to
690 stop.
691 .Pp
692 The controlling terminal will remain in this state until it is reinitialized
693 ithh a successful open by the controlling process, or deallocated by the
694 controlling process.
695 .Ss "Terminal Parameters"
696 The parameters that control the behavior of devices and modules providing the
697 .Vt termios
698 interface are specified by the
699 .Vt termios
700 structure defined by
701 .In termios.h .
702 Several
703 .Xr ioctl 2
704 system calls that fetch or change
705 these parameters use this structure that contains the following members:
706 .Bd -literal -offset 2n
707 tcflag_t c_iflag; /* input modes */
708 tcflag_t c_oflag; /* output modes */
709 tcflag_t c_cflag; /* control modes */
710 tcflag_t c_lflag; /* local modes */
711 cc_t c_cc[NCCS]; /* control chars */
712 .Ed
713 .Pp
|
1 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
2 .\" Copyright 2019, Joyent, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the
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 .Dd February 17, 2020
19 .Dt TERMIO 7I
20 .Os
21 .Sh NAME
22 .Nm termio
23 .Nd general terminal interface
24 .Sh SYNOPSIS
25 .In termio.h
26 .Fn ioctl "int fildes" "int request" "struct termio *arg"
27 .Fn ioctl "int fildes" "int request" "int arg"
28 .Pp
29 .In termios.h
30 .Fn ioctl "int fildes" "int request" "struct termios *arg"
31 .Sh DESCRIPTION
32 This release supports a general interface for asynchronous communications ports
33 that is hardware-independent.
34 The user interface to this functionality is using
35 function calls (the preferred interface) described in
36 .Xr termios 3C
37 or
38 .Fn ioctl
216 .Sy WERASE
217 will erase beyond the beginning of the line.
218 The
219 .Sy KILL
220 character (by default,
221 the character
222 .Sy NAK )
223 kills (deletes) the entire input line, and optionally
224 outputs a newline character.
225 All these characters operate on a key stroke basis,
226 independent of any backspacing or tabbing that may have been done.
227 The
228 .Sy REPRINT
229 character (the character
230 .Sy Control-r )
231 prints a newline followed by all characters that have not been read.
232 Reprinting also occurs automatically if
233 characters that would normally be erased from the screen are fouled by program
234 output.
235 The characters are reprinted as if they were being echoed;
236 consequently, if
237 .Dv ECHO
238 is not set, they are not printed.
239 .Pp
240 The
241 .Sy ERASE ,
242 .Sy ERASE2 ,
243 and
244 .Sy KILL
245 characters may be entered literally by preceding them with the escape character.
246 In this case, the escape character is not read.
247 The erase, erase2, and kill characters may be changed.
248 .Ss "Non-canonical Mode Input Processing"
249 In non-canonical mode input processing, input characters are not assembled into
250 lines, and erase and kill processing does not occur.
251 The
252 .Sy MIN
253 and
254 .Sy TIME
255 values are used to determine how to process the characters received.
256 .Pp
390 .Po
391 .Sy MIN
392 = 0,
393 .Sy TIME
394 > 0
395 .Pc ,
396 .Sy TIME
397 represents a read timer.
398 .El
399 .Pp
400 These two points highlight the dual purpose of the
401 .Sy MIN/TIME
402 feature.
403 Cases A and B, where
404 .Sy MIN
405 > 0, exist to handle burst mode activity (for
406 example, file transfer programs), where a program would like to process at
407 least
408 .Sy MIN
409 characters at a time.
410 In case A, the intercharacter timer is
411 activated by a user as a safety measure; in case B, the timer is turned off.
412 .Pp
413 Cases C and D exist to handle single character, timed transfers.
414 These cases
415 are readily adaptable to screen-based applications that need to know if a
416 character is present in the input queue before refreshing the screen.
417 In case
418 C, the read is timed, whereas in case D, it is not.
419 .Pp
420 Another important note is that
421 .Sy MIN
422 is always just a minimum.
423 It does not
424 denote a record length.
425 For example, if a program does a read of 20 bytes,
426 .Sy MIN
427 is 10, and 25 characters are present, then 20 characters will be
428 returned to the user.
429 .Ss "Writing Characters"
430 When one or more characters are written, they are transmitted to the terminal
431 as soon as previously written characters have finished typing.
432 Input characters
433 are echoed as they are typed if echoing has been enabled.
434 If a process produces
435 characters more rapidly than they can be typed, it will be suspended when its
436 output queue exceeds some limit.
437 When the queue is drained down to some
438 threshold, the program is resumed.
439 .Ss "Special Characters"
440 Certain characters have special functions on input.
441 These functions and their default character values are summarized as follows:
442 .Bl -tag -width REPRINT
443 .It Sy INTR
444 (Control-c or
445 .Sy ASCII ETX )
446 generates a
447 .Dv SIGINT
448 signal.
449 .Dv SIGINT
450 is sent to all foreground processes associated with the controlling terminal.
451 Normally, each such process is forced to terminate, but arrangements may be
452 made either to ignore the signal or to receive a trap to an agreed upon
673 is closed.
674 .Pp
675 If the controlling process is not in the foreground process group of the
676 terminal, a
677 .Dv SIGTSTP
678 is sent to the terminal's foreground process group.
679 Unless other arrangements have been made, these signals cause the processes to
680 stop.
681 .Pp
682 Processes in background process groups that attempt to access the controlling
683 terminal after modem disconnect while the terminal is still allocated to the
684 session will receive appropriate
685 .Dv SIGTTOU
686 and
687 .Dv SIGTTIN
688 signals.
689 Unless other arrangements have been made, this signal causes the processes to
690 stop.
691 .Pp
692 The controlling terminal will remain in this state until it is reinitialized
693 with a successful open by the controlling process, or deallocated by the
694 controlling process.
695 .Ss "Terminal Parameters"
696 The parameters that control the behavior of devices and modules providing the
697 .Vt termios
698 interface are specified by the
699 .Vt termios
700 structure defined by
701 .In termios.h .
702 Several
703 .Xr ioctl 2
704 system calls that fetch or change
705 these parameters use this structure that contains the following members:
706 .Bd -literal -offset 2n
707 tcflag_t c_iflag; /* input modes */
708 tcflag_t c_oflag; /* output modes */
709 tcflag_t c_cflag; /* control modes */
710 tcflag_t c_lflag; /* local modes */
711 cc_t c_cc[NCCS]; /* control chars */
712 .Ed
713 .Pp
|