Subject: dialin/dialout
To: None <tech-kern@NetBSD.ORG>
From: David Seifert <seifert@sequent.com>
List: tech-kern
Date: 03/21/1998 17:19:13
> On Sat, 21 Mar 1998, Paul A Vixie wrote:
>
>> I've always preferred to have O_NONBLOCK just be a way to force an
>> EWOULDBLOCK errno rather than a way to bypass carrier checking, but
>> I don't know how to get a tty device open (so I can set its CLOCAL)
>> if its carrier isn't up unless we use O_NONBLOCK on tty devices to
>> mean "ignore carrier when opening, but return EIO on read and write
>> unless either carrier is on or CLOCAL is on".  Maybe a new open flag
>> like O_IGNCARR?
>
> As far as I am concerned, this is the true matter behind the cua/tty
> debate.  I too get an icky feeling when using O_NONBLOCK to ignore carrier
> detect on open.  If someone solve it some other way I will be just as
> satisfied and will shut up about the whole thing.  However, it seems
> really wrong to export an idea like ``carrier detect'' into the open()
> call.  Thus, I find the cua/tty device split as the best option so far.

You need to open the device in two different ways.
What could be cleaner than supplying a flag to the open(2) call?

Rather than *ignoring* carrier detect, the better way is to *reverse*
the test when opening for dialout:

	DCD low: no one is using the port, go ahead and open it

	DCD high: someone is using the port, block

This requires only a truely trivial amount of kernel code to implement,
and works fine.

Mods to uucp and tip/cu are also trivial.

And no /dev pollution.  No wasted major/minor numbers.

-Dave