qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning


From: Stuart Brady
Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning
Date: Sun, 10 May 2009 23:15:00 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]