From: Johan Hovold <johan@kernel.org>
To: "Frank Schäfer" <fschaefer.oss@googlemail.com>
Cc: Johan Hovold <johan@kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: read() from removed usb-serial device
Date: Tue, 7 Jul 2020 17:16:22 +0200 [thread overview]
Message-ID: <20200707151622.GK3453@localhost> (raw)
In-Reply-To: <4f43f7ac-33ea-df67-f623-a7edc3d14c4c@googlemail.com>
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
next prev parent reply other threads:[~2020-07-07 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 14:49 read() from removed usb-serial device Frank Schäfer
2020-07-07 15:16 ` Johan Hovold [this message]
2020-07-07 15:19 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200707151622.GK3453@localhost \
--to=johan@kernel.org \
--cc=fschaefer.oss@googlemail.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.