Re: read() from removed usb-serial device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 07, 2020 at 04:49:31PM +0200, Frank Schäfer wrote:
> Hi,
> 
> I recently noticed that read() from a usb-serial device does not fail 
> after the device got removed.
> Is this really the correct/expected behavior or a bug ?
> 
> I would expect it to return -1 and set an appropriate errno, but it 
> returns 0 (no error, no bytes read) instead.
> 
> According to the glibc developers "glibc just calls into the kernel and 
> reports back whatever it receives from there."

Yeah, this is the expected behaviour for a hung up tty (see poll(2) or
the POSIX spec).

Johan



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux