From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3qxI-00073J-MA for qemu-devel@nongnu.org; Tue, 12 May 2009 08:19:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3qxC-00071o-2V for qemu-devel@nongnu.org; Tue, 12 May 2009 08:19:30 -0400 Received: from [199.232.76.173] (port=55948 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3qxB-00071a-NN for qemu-devel@nongnu.org; Tue, 12 May 2009 08:19:25 -0400 Received: from mail2.shareable.org ([80.68.89.115]:45802) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3qxB-0003EF-Bx for qemu-devel@nongnu.org; Tue, 12 May 2009 08:19:25 -0400 Date: Tue, 12 May 2009 13:19:21 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning Message-ID: <20090512121920.GA30617@shareable.org> References: <20090510221500.GA27879@miranda.arrow> <20090510.195335.-1303462317.imp@bsdimp.com> <20090511154226.GA29818@miranda.arrow> <4A084F58.7030706@codemonkey.ws> <20090511162520.GB1579@redhat.com> <4A0858EC.4080509@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A0858EC.4080509@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Stuart Brady , qemu-devel@nongnu.org Anthony Liguori wrote: > 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. It's not true on Linux - see "man 7 signal" which explains in some detail. It's not true in general for particular system calls like select(). > 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. I agree in practice. -- Jamie