Thread (5 messages) 5 messages, 4 authors, 1999-09-17

Re: stty < /dev/modem blocks???

From: Paul Mackerras <hidden>
Date: 1999-09-17 00:36:58

Michel Lanners [off-list ref] wrote:
OK, this sounds right, but how do you explain that I can get at the tty
settings with

stty -a < /dev/ttySx

for both of my serial ports, with absolutely nothing connected to them?
It depends on the state of the CLOCAL flag.  If it's set, which is
the default on boot, you can open it without waiting.  If it's clear,
an open will normally block until the CD (carrier detect) input is
asserted.  (To open it without waiting when CLOCAL is clear, you put
O_NONBLOCK in the flags on the open system call.)

When you run pppd, it will normally clear the CLOCAL flag (unless you
give it the `local' option), so that it can tell when the modem hangs
up.  It tries to restore the settings on exit, but this can fail if
the modem has already hung up, since after a hangup, the linux tty
driver won't let you do anything at all with the fd you had open to
the tty except close it.

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help