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: Jamie Lokier
Subject: Re: [Qemu-devel] [PATCH] suppress 'warn_unused_result' warning
Date: Tue, 12 May 2009 13:19:21 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

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