Re: select(2), usbserial, tty's and disconnect

From: linux-os
Date: Tue Mar 08 2005 - 11:28:35 EST

On Tue, 8 Mar 2005, Joerg Pommnitz wrote:

Hello all,
currently it seems that select keeps blocking when the USB device behind
ttyUSBx gets unplugged. My understanding is, that select should return
when the next call to one of the operations (read/write) will not block.
This is certainly true for failing with ENODEV. So, is this an issue
that will be fixed or should I poll (not the syscall) the device? Or is
there another way to monitor for a vanishing tty (it should not be USB

Thanks in advance

In principle, you need to set your device handle (socket or fd)
to non-blocking before you use select() or poll(). It was never
resolved if the current behavior is a BUG. Nevertheless, it
is unlikely that it will be fixed because there is the belief
that it is NOT a BUG and even if it is a BUG, programs depend
upon this BUG to work.

Dick Johnson
Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at