Print this page
12315 errors in section 7i of the manual


  99      no matter how many characters are requested in the read call, at most one
 100      line will be returned.  It is not necessary, however, to read a whole
 101      line at once; any number of characters may be requested in a read, even
 102      one, without losing information.
 103 
 104      During input, erase, erase2, and kill processing is normally done.  The
 105      ERASE and ERASE2 character (by default, the character DEL for ERASE and
 106      Control-h for ERASE2) erases the last character typed.  The WERASE
 107      character (the character Control-w) erases the last "word" typed in the
 108      current input line (but not any preceding spaces or tabs).  A "word" is
 109      defined as a sequence of non-blank characters, with tabs counted as
 110      blanks.  None of ERASE or ERASE2 or WERASE will erase beyond the
 111      beginning of the line.  The KILL character (by default, the character
 112      NAK) kills (deletes) the entire input line, and optionally outputs a
 113      newline character.  All these characters operate on a key stroke basis,
 114      independent of any backspacing or tabbing that may have been done.  The
 115      REPRINT character (the character Control-r) prints a newline followed by
 116      all characters that have not been read.  Reprinting also occurs
 117      automatically if characters that would normally be erased from the screen
 118      are fouled by program output.  The characters are reprinted as if they
 119      were being echoed; consequencely, if ECHO is not set, they are not
 120      printed.
 121 
 122      The ERASE, ERASE2, and KILL characters may be entered literally by
 123      preceding them with the escape character.  In this case, the escape
 124      character is not read.  The erase, erase2, and kill characters may be
 125      changed.
 126 
 127    Non-canonical Mode Input Processing
 128      In non-canonical mode input processing, input characters are not
 129      assembled into lines, and erase and kill processing does not occur.  The
 130      MIN and TIME values are used to determine how to process the characters
 131      received.
 132 
 133      MIN represents the minimum number of characters that should be received
 134      when the read is satisfied (that is, when the characters are returned to
 135      the user).  TIME is a timer of 0.10-second granularity that is used to
 136      timeout bursty and short-term data transmissions.  The four possible
 137      values for MIN and TIME and their interactions are described below.
 138 
 139      Case A: MIN > 0, TIME > 0    In this case, TIME serves as an intercharacter


 191                                 requested or the number of characters
 192                                 currently available is returned without
 193                                 waiting for more characters to be input.
 194 
 195    Comparing Different Cases of MIN, TIME Interaction
 196      Some points to note about MIN and TIME:
 197 
 198        o   In the following explanations, note that the interactions of MIN
 199            and TIME are not symmetric.  For example, when MIN >      0 and TIME =
 200            0, TIME has no effect.  However, in the opposite case, where MIN =
 201            0 and TIME >      0, both MIN and TIME play a role in that MIN is
 202            satisfied with the receipt of a single character.
 203 
 204        o   Also note that in case A (MIN > 0, TIME > 0), TIME represents an
 205            intercharacter timer, whereas in case C (MIN = 0, TIME > 0),      TIME
 206            represents a read timer.
 207 
 208      These two points highlight the dual purpose of the MIN/TIME feature.
 209      Cases A and B, where MIN >      0, exist to handle burst mode activity (for
 210      example, file transfer programs), where a program would like to process
 211      at least MIN characters at a time.  In case A, the inteercharacter timer
 212      is activated by a user as a safety measure; in case B, the timer is
 213      turned off.
 214 
 215      Cases C and D exist to handle single character, timed transfers.  These
 216      cases are readily adaptable to screen-based applications that need to
 217      know if a character is present in the input queue before refreshing the
 218      screen.  In case C, the read is timed, whereas in case D, it is not.
 219 
 220      Another important note is that MIN is always just a minimum.  It does not
 221      denote a record length.  For example, if a program does a read of 20
 222      bytes, MIN is 10, and 25 characters are present, then 20 characters will
 223      be returned to the user.
 224 
 225    Writing Characters
 226      When one or more characters are written, they are transmitted to the
 227      terminal as soon as previously written characters have finished typing.
 228      nputt characters are echoed as they are typed if echoing has been
 229      enabled.  If a process produces characters more rapidly than they can be
 230      typed, it will be suspended when its output queue exceeds some limit.
 231      When the queue is drained down to some threshold, the program is resumed.
 232 
 233    Special Characters
 234      Certain characters have special functions on input.  These functions and
 235      their default character values are summarized as follows:
 236 
 237      INTR     (Control-c or ASCII ETX) generates a SIGINT signal.  SIGINT is
 238               sent to all foreground processes associated with the controlling
 239               terminal.  Normally, each such process is forced to terminate,
 240               but arrangements may be made either to ignore the signal or to
 241               receive a trap to an agreed upon location.  (See
 242               signal.h(3HEAD)).
 243 
 244      QUIT     (Control-| or ASCII FS) generates a SIGQUIT signal.  Its
 245               treatment is identical to the interrupt signal except that,
 246               unless a receiving process has made other arrangements, it will
 247               not only be terminated but a core image file (called core) will
 248               be created in the current working directory.


 332 
 333    Modem Disconnect
 334      When a modem disconnect is detected, a SIGHUP signal is sent to the
 335      terminal's controlling process.  Unless other arrangements have been
 336      made, these signals cause the process to terminate.  If SIGHUP is ignored
 337      or caught, any subsequent read returns with an end-of-file indication
 338      until the terminal is closed.
 339 
 340      If the controlling process is not in the foreground process group of the
 341      terminal, a SIGTSTP is sent to the terminal's foreground process group.
 342      Unless other arrangements have been made, these signals cause the
 343      processes to stop.
 344 
 345      Processes in background process groups that attempt to access the
 346      controlling terminal after modem disconnect while the terminal is still
 347      allocated to the session will receive appropriate SIGTTOU and SIGTTIN
 348      signals.  Unless other arrangements have been made, this signal causes
 349      the processes to stop.
 350 
 351      The controlling terminal will remain in this state until it is
 352      reinitialized ithh a successful open by the controlling process, or
 353      deallocated by the controlling process.
 354 
 355    Terminal Parameters
 356      The parameters that control the behavior of devices and modules providing
 357      the termios interface are specified by the termios structure defined by
 358      <termios.h>.  Several ioctl(2) system calls that fetch or change these
 359      parameters use this structure that contains the following members:
 360 
 361        tcflag_t        c_iflag;        /* input modes */
 362        tcflag_t        c_oflag;        /* output modes */
 363        tcflag_t        c_cflag;        /* control modes */
 364        tcflag_t        c_lflag;        /* local modes */
 365        cc_t            c_cc[NCCS];     /* control chars */
 366 
 367      The special control characters are defined by the array c_cc.  The
 368      symbolic name NCCS is the size of the Control-character array and is also
 369      defined by <termios.h>.  The relative positions, subscript   names, and
 370      typical default values for each function are as follows:
 371 
 372      Relative Position    Subscript Name    Typical Default Value


1055 
1056                    tv is the system clock timestamp when the event (pulse on
1057                    the DCD pin) occurred.  serial is the ordinal of the event,
1058                    which each consecutive event being assigned the next
1059                    ordinal.  The first event registered gets a serial value of
1060                    1.  The TIOCGPPSEV returns the last event registered;
1061                    multiple calls will persistently return the same event
1062                    until a new one is registered.  In addition to time
1063                    stamping and saving the event, if it is of one-second
1064                    period and of consistently high accuracy, the local system
1065                    clock will automatically calibrate to it.
1066 
1067 FILES
1068      Files in or under /dev
1069 
1070 SEE ALSO
1071      stty(1), fork(2), getpgid(2), getsid(2), ioctl(2), setsid(2),
1072      sigaction(2), signal(3C), tcsetpgrp(3C), termios(3C), signal.h(3HEAD),
1073      streamio(7I)
1074 
1075 illumos                         March 17, 2019                         illumos


  99      no matter how many characters are requested in the read call, at most one
 100      line will be returned.  It is not necessary, however, to read a whole
 101      line at once; any number of characters may be requested in a read, even
 102      one, without losing information.
 103 
 104      During input, erase, erase2, and kill processing is normally done.  The
 105      ERASE and ERASE2 character (by default, the character DEL for ERASE and
 106      Control-h for ERASE2) erases the last character typed.  The WERASE
 107      character (the character Control-w) erases the last "word" typed in the
 108      current input line (but not any preceding spaces or tabs).  A "word" is
 109      defined as a sequence of non-blank characters, with tabs counted as
 110      blanks.  None of ERASE or ERASE2 or WERASE will erase beyond the
 111      beginning of the line.  The KILL character (by default, the character
 112      NAK) kills (deletes) the entire input line, and optionally outputs a
 113      newline character.  All these characters operate on a key stroke basis,
 114      independent of any backspacing or tabbing that may have been done.  The
 115      REPRINT character (the character Control-r) prints a newline followed by
 116      all characters that have not been read.  Reprinting also occurs
 117      automatically if characters that would normally be erased from the screen
 118      are fouled by program output.  The characters are reprinted as if they
 119      were being echoed; consequently, if ECHO is not set, they are not
 120      printed.
 121 
 122      The ERASE, ERASE2, and KILL characters may be entered literally by
 123      preceding them with the escape character.  In this case, the escape
 124      character is not read.  The erase, erase2, and kill characters may be
 125      changed.
 126 
 127    Non-canonical Mode Input Processing
 128      In non-canonical mode input processing, input characters are not
 129      assembled into lines, and erase and kill processing does not occur.  The
 130      MIN and TIME values are used to determine how to process the characters
 131      received.
 132 
 133      MIN represents the minimum number of characters that should be received
 134      when the read is satisfied (that is, when the characters are returned to
 135      the user).  TIME is a timer of 0.10-second granularity that is used to
 136      timeout bursty and short-term data transmissions.  The four possible
 137      values for MIN and TIME and their interactions are described below.
 138 
 139      Case A: MIN > 0, TIME > 0    In this case, TIME serves as an intercharacter


 191                                 requested or the number of characters
 192                                 currently available is returned without
 193                                 waiting for more characters to be input.
 194 
 195    Comparing Different Cases of MIN, TIME Interaction
 196      Some points to note about MIN and TIME:
 197 
 198        o   In the following explanations, note that the interactions of MIN
 199            and TIME are not symmetric.  For example, when MIN >      0 and TIME =
 200            0, TIME has no effect.  However, in the opposite case, where MIN =
 201            0 and TIME >      0, both MIN and TIME play a role in that MIN is
 202            satisfied with the receipt of a single character.
 203 
 204        o   Also note that in case A (MIN > 0, TIME > 0), TIME represents an
 205            intercharacter timer, whereas in case C (MIN = 0, TIME > 0),      TIME
 206            represents a read timer.
 207 
 208      These two points highlight the dual purpose of the MIN/TIME feature.
 209      Cases A and B, where MIN >      0, exist to handle burst mode activity (for
 210      example, file transfer programs), where a program would like to process
 211      at least MIN characters at a time.  In case A, the intercharacter timer
 212      is activated by a user as a safety measure; in case B, the timer is
 213      turned off.
 214 
 215      Cases C and D exist to handle single character, timed transfers.  These
 216      cases are readily adaptable to screen-based applications that need to
 217      know if a character is present in the input queue before refreshing the
 218      screen.  In case C, the read is timed, whereas in case D, it is not.
 219 
 220      Another important note is that MIN is always just a minimum.  It does not
 221      denote a record length.  For example, if a program does a read of 20
 222      bytes, MIN is 10, and 25 characters are present, then 20 characters will
 223      be returned to the user.
 224 
 225    Writing Characters
 226      When one or more characters are written, they are transmitted to the
 227      terminal as soon as previously written characters have finished typing.
 228      Input characters are echoed as they are typed if echoing has been
 229      enabled.  If a process produces characters more rapidly than they can be
 230      typed, it will be suspended when its output queue exceeds some limit.
 231      When the queue is drained down to some threshold, the program is resumed.
 232 
 233    Special Characters
 234      Certain characters have special functions on input.  These functions and
 235      their default character values are summarized as follows:
 236 
 237      INTR     (Control-c or ASCII ETX) generates a SIGINT signal.  SIGINT is
 238               sent to all foreground processes associated with the controlling
 239               terminal.  Normally, each such process is forced to terminate,
 240               but arrangements may be made either to ignore the signal or to
 241               receive a trap to an agreed upon location.  (See
 242               signal.h(3HEAD)).
 243 
 244      QUIT     (Control-| or ASCII FS) generates a SIGQUIT signal.  Its
 245               treatment is identical to the interrupt signal except that,
 246               unless a receiving process has made other arrangements, it will
 247               not only be terminated but a core image file (called core) will
 248               be created in the current working directory.


 332 
 333    Modem Disconnect
 334      When a modem disconnect is detected, a SIGHUP signal is sent to the
 335      terminal's controlling process.  Unless other arrangements have been
 336      made, these signals cause the process to terminate.  If SIGHUP is ignored
 337      or caught, any subsequent read returns with an end-of-file indication
 338      until the terminal is closed.
 339 
 340      If the controlling process is not in the foreground process group of the
 341      terminal, a SIGTSTP is sent to the terminal's foreground process group.
 342      Unless other arrangements have been made, these signals cause the
 343      processes to stop.
 344 
 345      Processes in background process groups that attempt to access the
 346      controlling terminal after modem disconnect while the terminal is still
 347      allocated to the session will receive appropriate SIGTTOU and SIGTTIN
 348      signals.  Unless other arrangements have been made, this signal causes
 349      the processes to stop.
 350 
 351      The controlling terminal will remain in this state until it is
 352      reinitialized with a successful open by the controlling process, or
 353      deallocated by the controlling process.
 354 
 355    Terminal Parameters
 356      The parameters that control the behavior of devices and modules providing
 357      the termios interface are specified by the termios structure defined by
 358      <termios.h>.  Several ioctl(2) system calls that fetch or change these
 359      parameters use this structure that contains the following members:
 360 
 361        tcflag_t        c_iflag;        /* input modes */
 362        tcflag_t        c_oflag;        /* output modes */
 363        tcflag_t        c_cflag;        /* control modes */
 364        tcflag_t        c_lflag;        /* local modes */
 365        cc_t            c_cc[NCCS];     /* control chars */
 366 
 367      The special control characters are defined by the array c_cc.  The
 368      symbolic name NCCS is the size of the Control-character array and is also
 369      defined by <termios.h>.  The relative positions, subscript   names, and
 370      typical default values for each function are as follows:
 371 
 372      Relative Position    Subscript Name    Typical Default Value


1055 
1056                    tv is the system clock timestamp when the event (pulse on
1057                    the DCD pin) occurred.  serial is the ordinal of the event,
1058                    which each consecutive event being assigned the next
1059                    ordinal.  The first event registered gets a serial value of
1060                    1.  The TIOCGPPSEV returns the last event registered;
1061                    multiple calls will persistently return the same event
1062                    until a new one is registered.  In addition to time
1063                    stamping and saving the event, if it is of one-second
1064                    period and of consistently high accuracy, the local system
1065                    clock will automatically calibrate to it.
1066 
1067 FILES
1068      Files in or under /dev
1069 
1070 SEE ALSO
1071      stty(1), fork(2), getpgid(2), getsid(2), ioctl(2), setsid(2),
1072      sigaction(2), signal(3C), tcsetpgrp(3C), termios(3C), signal.h(3HEAD),
1073      streamio(7I)
1074 
1075 illumos                        February 17, 2020                       illumos