* Blocking open problem on Digital Unix
@ 1999-03-04 5:00 dshifflett
1999-03-07 5:00 ` Lawrence Kirby
1999-03-08 5:00 ` Tom Leitner
0 siblings, 2 replies; 4+ messages in thread
From: dshifflett @ 1999-03-04 5:00 UTC (permalink / raw)
To: dshifflett
I am having trouble when opening a device with the
O_NONBLOCK option.
I am using Digital Unix 4.0d,
my device is mapped, using LAT,
to a terminal server port, a DEC 90TL terminal server.
The terminal server port is configured to not allow
the connection until the modem signals are active.
My problem is that the open call is hanging,
(because I disconnected the modem, to test this case)
and I expected it to return with some error
indicating the blocked state of the device.
If anyone has any experience in this,
or ideas on what to try I would appreciate
hearing them.
Thanks,
dave
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Blocking open problem on Digital Unix
1999-03-04 5:00 Blocking open problem on Digital Unix dshifflett
@ 1999-03-07 5:00 ` Lawrence Kirby
1999-03-12 5:00 ` Wesley W. Garland
1999-03-08 5:00 ` Tom Leitner
1 sibling, 1 reply; 4+ messages in thread
From: Lawrence Kirby @ 1999-03-07 5:00 UTC (permalink / raw)
In article <7bmga9$ncr$1@nnrp1.dejanews.com> dshifflett@gwdi.com writes:
>I am having trouble when opening a device with the
>O_NONBLOCK option.
What you're asking about is a Unix/POSIX feature and not a feature
of the C or C++ programming languages (so I've removed them from followups).
>I am using Digital Unix 4.0d,
>my device is mapped, using LAT,
>to a terminal server port, a DEC 90TL terminal server.
>
>The terminal server port is configured to not allow
>the connection until the modem signals are active.
>
>My problem is that the open call is hanging,
>(because I disconnected the modem, to test this case)
>and I expected it to return with some error
>indicating the blocked state of the device.
Either there's a bug in the system or a bug in your code. Why not post a
minimal but complete example program so we can verify that the code isn't
the problem, and others might be able to test the code on similar
systems.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Blocking open problem on Digital Unix
1999-03-04 5:00 Blocking open problem on Digital Unix dshifflett
1999-03-07 5:00 ` Lawrence Kirby
@ 1999-03-08 5:00 ` Tom Leitner
1 sibling, 0 replies; 4+ messages in thread
From: Tom Leitner @ 1999-03-08 5:00 UTC (permalink / raw)
In comp.unix.osf.osf1 dshifflett@gwdi.com wrote:
> I am having trouble when opening a device with the
> O_NONBLOCK option.
> I am using Digital Unix 4.0d,
> my device is mapped, using LAT,
> to a terminal server port, a DEC 90TL terminal server.
> The terminal server port is configured to not allow
> the connection until the modem signals are active.
> My problem is that the open call is hanging,
> (because I disconnected the modem, to test this case)
> and I expected it to return with some error
> indicating the blocked state of the device.
> If anyone has any experience in this,
> or ideas on what to try I would appreciate
> hearing them.
Use this for opening the port:
chan = open (device, O_RDONLY | O_NDELAY);
{
int i;
i = fcntl(chan, F_GETFL);
i &= ~O_NDELAY;
fcntl(chan, F_SETFL, i);
}
Tom
--
Tom Leitner Dept. of Communications, Graz Univ. of Technology,
tom@radar.tu-graz.ac.at Inffeldgasse 12, A-8010 Graz / Austria / Europe
PGP public key @ http://wiis.tu-graz.ac.at/people/tom.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Blocking open problem on Digital Unix
1999-03-07 5:00 ` Lawrence Kirby
@ 1999-03-12 5:00 ` Wesley W. Garland
0 siblings, 0 replies; 4+ messages in thread
From: Wesley W. Garland @ 1999-03-12 5:00 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
>>I am having trouble when opening a device with the
>>O_NONBLOCK option.
>
>What you're asking about is a Unix/POSIX feature and not a feature
>of the C or C++ programming languages (so I've removed them from
followups).
>
>>I am using Digital Unix 4.0d,
>>my device is mapped, using LAT,
>>to a terminal server port, a DEC 90TL terminal server.
>>
>>The terminal server port is configured to not allow
>>the connection until the modem signals are active.
>>
>>My problem is that the open call is hanging,
>>(because I disconnected the modem, to test this case)
>>and I expected it to return with some error
>>indicating the blocked state of the device.
The problem you're seeing here is almost certainly solvable by
twiddling your tty settings -- read the man pages for termios()
and stty(). I think you're most interested in the clocal bit.
What you're probably seeings is a block at the hardware or
driver level which is waiting for the modem to assert DCD,
which it is not going to do unless you either program it to
always leave it on (AT&C0, AT&W for most), or you tell the
low-level driver to ignore it.
I have had this problem under various unices (but not OSF,
I've never used it) and this always solved it.
Cheers,
Wes
--
Wesley W. Garland���������������� | Email: wes@page.ca���
Director, Product Development���� | Pager: wes-pager@kingston.net
PageMail, Inc.������������������� |
Kingston, ON Canada�������������� | Voice: (888) 247 6246
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-03-12 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-04 5:00 Blocking open problem on Digital Unix dshifflett
1999-03-07 5:00 ` Lawrence Kirby
1999-03-12 5:00 ` Wesley W. Garland
1999-03-08 5:00 ` Tom Leitner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox