Subject: Re: com driver once again
To: None <tron@colwyn.owl.de>
From: G. David Butler <butler@sun1-dal.tx.stratus.com>
List: port-i386
Date: 06/15/1995 12:48:09
> Charles M. Hannum said:
> > What, precisely, are you trying to do?
> 
> Using "/dev/tty01" WITHOUT an active carrier e.g. to dial out with "chat".
> 
> > The redirection is superfluous and will just cause the shell to hang
> > trying to open the device because there's no carrier.
> 
> I still do not understand why you thinks this is the correct behavior.
> I've never seend any operating system blocking the serial devices if
> there's no carrier. Excuse me but I consider this as somehow brain dead.
> 
> -- 
> Matthias Scheler
> tron@colwyn.owl.de

It is correct for a open to block on a tty device without carrier asserted.
(You don't expect getty to wait around forever, do you?)

If you (or "chat") wants to open without blocking, it should "say" so in
the open call (O_NONBLOCK), then "say" that you want to talk to the port
without carrier (ioctl(CLOCAL)), then turn off non blocking
(fnctl(~O_NONBLOCK)), then talk to the modem and get the word CONNECT,
then turn on HUPCL and turn off CLOCAL (ioctl(|=HUPCL &=~CLOCAL) and proceed.
In this way, if you lose carrier, the port will close on the process
without it having to look for NO CARRIER....

This is the way it has been done in the *NIX world since day one.

Now, I do/have used split drivers like what is on SUNs, FAS for SYS V,
and sio on FreeBSD and I do like that approach better.  This is a
relegious discussion between those who think this stuff should be in
user space and those who don't.  But it must be SOMEWHERE!

David Butler
Home: gdb@ninja.lonestar.org
Work: butler@sun1-dal.tx.stratus.com