Xref: utzoo comp.sys.att:4881 unix-pc.general:1811
Path: utzoo!utgpu!watmath!uunet!cbmvax!ditto
From: ditto@cbmvax.UUCP (Michael "Ford" Ditto)
Newsgroups: comp.sys.att,unix-pc.general
Subject: Re: Can't read netnews with "rn" from dialup ?
Summary: /dev/ph[01] drivers are bogus ... you can modify "rn" or the driver
Keywords: unixpc
Message-ID: <5437@cbmvax.UUCP>
Date: 5 Dec 88 22:59:40 GMT
References: <149@orac.pgh.pa.us>
Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto)
Organization: Commodore Technology, West Chester, PA
Lines: 26

In article <149@orac.pgh.pa.us> pat@orac.pgh.pa.us (Pat Barron) writes:
> [ ... ] "rn" won't work when I'm dialed in on /dev/ph1 - it complains
>about not being able to open /dev/tty.

I'm sure you'll get lots of responses explaining what the problem is:
The Unix PC phone driver has a design flaw:  the mode which is passed
to open() is what it uses to decide whether you want "voice" or "data"
access.  O_RDONLY means VOICE access, which is not allowed when the
port is already open in DATA mode.

What most people do is modify the "rn" source code to open /dev/tty
with O_RDWR mode (change 2nd arg to open() from 0 to 2, or from
O_RDONLY to O_RDWR).  This won't fix any other programs or shell
scripts which open /dev/tty for reading.

What I did was to modify the /dev/ph? driver to ALWAYS use data mode.
This, of course, means that the phone manager is not usable, but I
never run it anyway.  I have this modification available as a loadable
driver (source code) if anyone wants it.
-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ford@kenobi.cts.com
- The Unix Programmer's Manual,		...!sdcsvax!crash!elgar!ford
  2nd Edition, June, 1972.		ditto@cbmvax.commodore.com