From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning
Date: Sun, 10 May 2009 23:15:00 +0100 [thread overview]
Message-ID: <20090510221500.GA27879@miranda.arrow> (raw)
In-Reply-To: <ee84806e0905101215gf32927j1b510a0084038e20@mail.gmail.com>
On Mon, May 11, 2009 at 03:15:11AM +0800, Chih-Min Chao wrote:
> The patch add error handling to functions with 'warn_unused_result' return
> value such as write, read, ftruncate, and realpath.
I'm slightly concerned -- read(), write() and ftruncate() can fail with
EINTR if a signal is received at an unfortunate time, can't they?
Do we mitigate this for the most part, somehow?
Do kernels try to avoid this behaviour? If so, under what circumstances
might EINTR still be returned?
Is it acceptable to have a wrapper around these functions that retries
if the call fails with EINTR?
I would guess that for the most part, getting EINTR back is pretty rare,
as there's an awful lot of code (in QEMU and in other projects) that
doesn't check for it.
BTW, is it be possible for the write in qemu_event_increment() to
io_thread_fd to fail with EAGAIN? If so, aborting with perror()
probably isn't right.
--
Stuart Brady
next prev parent reply other threads:[~2009-05-10 22:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-10 19:15 [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning Chih-Min Chao
2009-05-10 22:11 ` Paul Brook
2009-05-10 22:15 ` Stuart Brady [this message]
2009-05-10 23:19 ` Anthony Liguori
2009-05-11 1:53 ` M. Warner Losh
2009-05-11 15:42 ` Stuart Brady
2009-05-11 16:02 ` Paul Brook
2009-05-11 16:16 ` Anthony Liguori
2009-05-11 16:25 ` Daniel P. Berrange
2009-05-11 16:57 ` Anthony Liguori
2009-05-12 12:19 ` Jamie Lokier
2009-05-11 17:02 ` Jamie Lokier
2009-05-11 16:15 ` Daniel P. Berrange
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=20090510221500.GA27879@miranda.arrow \
--to=sdbrady@ntlworld.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).