[PATCH] Fix minor breakage on Cygwin: auth-passwd.c andsession.c

Gert Doering gert at greenie.muc.de
Tue Aug 12 03:04:05 EST 2003


Hi,

On Mon, Aug 11, 2003 at 04:55:17PM +0200, Corinna Vinschen wrote:
> > Either way, won't that just stop sending data (or send an XOFF/XON) rather
> > than than a real break (ie continuous +12V)?
> 
> I'm not sure what you mean.  tcsendbreak() might send data as well (from
> SUSv3):
> 
>   "If the terminal is using asynchronous serial data transmission,
>    tcsendbreak() shall cause transmission of a continuous stream of
>    zero-valued bits for a specific duration."
> 
> so it's not always a break in the sense of not sending data at all.  

Well, it's not a "break" but a "BREAK" signal.

The thing about async serial data is that there is a start bit, a number
of data bits (usually 8, but 5-7 are also possible), maybe a parity bit,
and 1 or 2 stop bits.  Either the start or the stop bit has to be "1", to
give the async receiver a chance to synchronize.  (I think the idle level
on the serial port is logical "1", the start bit is "0", and the stop bit
is "1" again - which transfers to "-12V", "+12V" and "-12V" again).

A BREAK signal is "sending more than 10 0-bits in sequence".  This is a
line code violation (normally that would be the time for a stop bit) so
the receiver can detect "this is a special signal and it is NOT any of 
the characters encodeable by the <n> data bits in use".

So the minimum time for a BREAK signal (on a serial port) is determined by
the actual port speed... a BREAK at 38400 can be much shorter than at 2400
bps :-) - but 0.3 seconds is a value that's "long enough" for just about
anything (even for 50 bps).

> Even
> on synchronous IO:
> 
>   "If the terminal is not using asynchronous serial data transmission,
>    it is implementation-defined whether tcsendbreak() sends data to
>    generate a break condition or returns without taking any action."

Synch serial ports don't have a clear concept of a BREAK - one could
transmit an AIS signal or some other error signal, but BREAK is something
very much asynchronous.

> Perhaps I don't sufficiently understand serial IO?

Be happy that you don't need to know all this cruft :-)

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert at greenie.muc.de
fax: +49-89-35655025                        gert at net.informatik.tu-muenchen.de




More information about the openssh-unix-dev mailing list