CBREAK mode - what ioctls ? FAQ c.u.p

CBREAK mode - what ioctls ? FAQ c.u.p

Post by Pat Spinl » Tue, 22 Mar 1994 17:24:35



Folks,

While porting a curses library to my box (hp-ux 9.0.1), I found that
hte library used CBREAK as an argument for a terminal ioctl().

I unfortunately can't find a definition for which terminal modes
cbreak actually is.  My guess is the following:

  1. ICANON off
  2. ECHO off
  3. flow control (IXON/IXOFF) off

and that I should leave input/output mapping and signal handling
alone.  

Am I missing anything ?  Am I mundging on something I shouldn't ?

I'll look through more documentation, and try to post an answer, if I
find one.

Thanks a ton !
-- Pat

--
Pat Spinler                             "Life ?  Life is a crock.

Work: 505/893-4655 Home: 505/294-5923   lonely a lot in between."

 
 
 

CBREAK mode - what ioctls ? FAQ c.u.p

Post by Stephen Bayn » Wed, 23 Mar 1994 21:34:24


:
: Folks,
:
: While porting a curses library to my box (hp-ux 9.0.1), I found that
: hte library used CBREAK as an argument for a terminal ioctl().
:
: I unfortunately can't find a definition for which terminal modes
: cbreak actually is.  My guess is the following:
:
:   1. ICANON off
:   2. ECHO off
:   3. flow control (IXON/IXOFF) off
:
: and that I should leave input/output mapping and signal handling
: alone.  
:
: Am I missing anything ?  Am I mundging on something I shouldn't ?
:
: I'll look through more documentation, and try to post an answer, if I
: find one.
:
: Thanks a ton !
: -- Pat
:
: --
: Pat Spinler                           "Life ?  Life is a crock.

: Work: 505/893-4655 Home: 505/294-5923 lonely a lot in between."

From the apollo bsd man pages
   Modes
     The terminal drivers have three major modes, characterized by the amount
     of processing on the input and output characters:

     cooked    The normal mode.  In this mode lines of input are collected and
               input editing is done.  The edited line is made available when
               it is completed by a newline, or when the t_brkc character
               (normally undefined) or t_eofc character (normally an EOT,
               control-D, hereafter ^D) is entered.  A carriage return is
               usually made synonymous with newline in this mode, and replaced
               with a newline whenever it is typed.  All driver functions
               (input editing, interrupt generation, output processing such as
               delay generation and tab expansion, etc.)  are available in
               this mode.

     CBREAK    This mode eliminates the character, word, and line editing
               input facilities, making the input character available to the
               user program as it is typed.  Flow control, literal-next and
               interrupt processing are still done in this mode.  Output
               processing is done.

     RAW       This mode eliminates all input processing and makes all input
               characters available as they are typed; no output processing is
               done either.

     The style of input processing can also be very different when the
     terminal is put in non-blocking I/O mode; see the FNDELAY flag described
     in fcntl(2).  In this case a read(2) from the control terminal will never
     block, but rather return an error indication (EWOULDBLOCK) if there is no
     input available.

     A process may also request that a SIGIO signal be sent it whenever input
     is present and also whenever output queues fall below the low-water mark.
     To enable this mode the FASYNC flag should be set using fcntl(2).

Note flow control and interupt processing is left on - this is why this mode
is much more useful than RAW for a lot of aplications.
--

Philips Semicondutors Ltd
Southampton                                 My views are my own.
United Kingdom