read() from a removed device

Florian Weimer
Mon Jul 6 17:17:30 GMT 2020

* Frank Schäfer via Libc-help:

> I just noticed that read() from a usb-serial device doesn't fail after
> the device got (physically) removed.
> I would expect it to return -1 and set an appropriate errno, but it
> returns 0 (no error, no bytes read) instead.
> Is this the correct/expected behavior or a bug ?

You need toask on one of the kernel mailing lists.  glibc just calls
into the kernel and reports back whatever it receives from there.


More information about the Libc-help mailing list