Re: open() hanging...



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
.



Relevant Pages

  • Re: Quickbasic stuff under DOSZ in new computers
    ... >>> qbasic to run sending bytes to the serial port. ... >>> the keyboard or the mouse to control qbasic (hitting the escape ... I would like to know whether it also hangs on your ... And why have you not installed SP2?? ...
    (comp.lang.basic.misc)
  • Re: Quickbasic stuff under DOSZ in new computers
    ... >> qbasic to run sending bytes to the serial port. ... >> the keyboard or the mouse to control qbasic (hitting the escape ... >> the serial port access is not working. ... The hangtest.exe file you sent hangs just like the script that is ...
    (comp.lang.basic.misc)
  • Re: Serial Port COM1: Problems With Window Mobile 5
    ... > The Window Mobile 5 hangs on suspend mode when the serial port was left ... > and connected to a device which streams data to the serial port. ... > serial device but right now I dont any idea as to why it hangs. ...
    (microsoft.public.pocketpc.developer)
  • program hangs on read(2) call
    ... i have software that does a readcall on a serial port. ... its expected and hangs. ... than exit the program as i set it up in my signal handler, it bumps me ... i used sigaction to setup my signal handler. ...
    (comp.os.linux.development.system)
  • open() hanging...
    ... I have encountered a problem when changing from one motherboard to ... unknown circumstances a call to openhangs. ... The process that that calls opendoes so several times over several hours until one call to openhangs. ... Maybe some can point me to a more suitable group in that case? ...
    (comp.os.linux.development.system)