From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3Yos-0000PB-Je for qemu-devel@nongnu.org; Mon, 11 May 2009 12:57:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3Yoo-0000NS-Qt for qemu-devel@nongnu.org; Mon, 11 May 2009 12:57:38 -0400 Received: from [199.232.76.173] (port=42445 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3Yoo-0000NM-I4 for qemu-devel@nongnu.org; Mon, 11 May 2009 12:57:34 -0400 Received: from yx-out-1718.google.com ([74.125.44.157]:64760) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3Yoo-0006fD-37 for qemu-devel@nongnu.org; Mon, 11 May 2009 12:57:34 -0400 Received: by yx-out-1718.google.com with SMTP id 6so1529886yxn.82 for ; Mon, 11 May 2009 09:57:33 -0700 (PDT) Message-ID: <4A0858EC.4080509@codemonkey.ws> Date: Mon, 11 May 2009 11:57:16 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning References: <20090510221500.GA27879@miranda.arrow> <20090510.195335.-1303462317.imp@bsdimp.com> <20090511154226.GA29818@miranda.arrow> <4A084F58.7030706@codemonkey.ws> <20090511162520.GB1579@redhat.com> In-Reply-To: <20090511162520.GB1579@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Stuart Brady , qemu-devel@nongnu.org Daniel P. Berrange wrote: > On Mon, May 11, 2009 at 11:16:24AM -0500, Anthony Liguori wrote: > >> Any system call can return EINTR just about. It's not just read/write. >> > > For many system calls you can have them auto-restarted after EINTR > by using sigaction() with the SA_RESTART flag. IIRC read/write/poll > won't support restarts in this way though, because of the problem of > partial data read/writes and partial timeouts for poll meaning you > can't auto-restart them without app developer help > SA_RESTART in theory is supposed to cover everything IIUC. I don't know that that's true in Linux in practice though. I definitely don't know about other Unices. I don't think there's a standard way to know which syscalls would be restarted and which ones would. If you expect EINTR, I think you pretty much have to handle it everywhere. Regards, Anthony Liguori > Daniel >