linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@cs.anu.edu.au>
To: linuxppc-dev@lists.linuxppc.org
Subject: Re: stty < /dev/modem blocks???
Date: Fri, 17 Sep 1999 10:36:58 +1000	[thread overview]
Message-ID: <199909170036.KAA13072@tango.anu.edu.au> (raw)
In-Reply-To: <199909160722.JAA00359@piglet.cpu.lu> (message from Michel Lanners on Thu, 16 Sep 1999 09:22:41 +0200 (CEST))


Michel Lanners <mlan@cpu.lu> 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/

      parent reply	other threads:[~1999-09-17  0:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-14  3:33 stty < /dev/modem blocks??? Lou Langholtz
1999-09-15 17:27 ` Randall R Schulz
1999-09-16  7:22   ` Michel Lanners
1999-09-16 20:14     ` Randall R Schulz
1999-09-17  0:36     ` Paul Mackerras [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199909170036.KAA13072@tango.anu.edu.au \
    --to=paulus@cs.anu.edu.au \
    --cc=Paul.Mackerras@cs.anu.edu.au \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).