From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3HI9-0000sI-GK for qemu-devel@nongnu.org; Sun, 10 May 2009 18:14:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3HI4-0000rO-Nf for qemu-devel@nongnu.org; Sun, 10 May 2009 18:14:41 -0400 Received: from [199.232.76.173] (port=59206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3HI4-0000rL-Kq for qemu-devel@nongnu.org; Sun, 10 May 2009 18:14:36 -0400 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]:60904) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3HI4-0002ia-4h for qemu-devel@nongnu.org; Sun, 10 May 2009 18:14:36 -0400 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090510221434.MBBB25388.mtaout02-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com> for ; Sun, 10 May 2009 23:14:34 +0100 Received: from miranda.arrow ([213.107.24.213]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090510221434.QJGJ22934.aamtaout04-winn.ispmail.ntl.com@miranda.arrow> for ; Sun, 10 May 2009 23:14:34 +0100 Received: from sdb by miranda.arrow with local (Exim 4.63) (envelope-from ) id 1M3HIS-0007Iz-AB for qemu-devel@nongnu.org; Sun, 10 May 2009 23:15:00 +0100 Date: Sun, 10 May 2009 23:15:00 +0100 From: Stuart Brady Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning Message-ID: <20090510221500.GA27879@miranda.arrow> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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