Re: open() hanging...
- From: floyd@xxxxxxxxxx (Floyd L. Davidson)
- Date: Fri, 20 Jan 2006 03:08:25 -0900
Mattias Brändström <"thebrasse at brasse dot org"> wrote:
>Hello,
>
>I have encountered a problem when changing from one motherboard
>to another (Abit IC7-G -> ASUS P5ND2). My problem is that under
>some unknown circumstances a call to open() hangs. The process
>that that calls open() does so several times over several hours
>until one call to open() hangs.
>
>Is open() allowed to behave this way? Shouldn't open() be
>unblocking and returning a fault if it can't open the device? If
>this is acceptable behaiviour for open() then how should one
>handle it?
>
>If this is off topic for this group I apologize. Maybe some can
>point me to a more suitable group in that case?
Assuming this open() is looking at a serial port, the call will
block if the DCD line is not active and the port is configured
to enable modem control lines.
Essentially, if you don't want open() to block, call it with the
O_NONBLOCK flag set. Then, if you want read() to block, you'll
have to clear that flag using fcntl().
RTFM of course...
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@xxxxxxxxxx
.
- References:
- open() hanging...
- From: Mattias Brändström
- open() hanging...
- Prev by Date: Re: Serial communication, detecting parity bits
- Next by Date: PF_PACKET Socket
- Previous by thread: open() hanging...
- Next by thread: PF_PACKET Socket
- Index(es):
Relevant Pages
|