Re: flock, FAGAIN, and FWOULDBLOCK
Matthew Wilcox wrote:
> On Sun, Feb 22, 2009 at 09:43:36PM -0500, Carlos O'Donell wrote:
>>> ...
>>> but somehow I suspect this interchangeable use of EAGAIN and EWOULDBLOCK
>>> is going to reveal latent problems in this part of the kernel I would
>>> rather not delve into...
>> The ABI is fixed, so all we can do is cleanup the uses in the kernel,
>> and make sure we adhere to the documented APIs.
>
> We actually can do better than this ...
>
> #ifdef __KERNEL__
> #define EWOULDBLOCK EAGAIN
> #else
> #define EWOULDBLOCK /* whatever the fuck HPUX uses */
> #endif
Wouldn't this hurt us if we at some point in time want to finish
the HPUX/Linux compat code in the parisc kernel?
Helge
> Now our kernel never returns -EWOULDBLOCK, only -EAGAIN. Correct
> applications must check for both. Incorrect applications tend to only
> check for AGAIN, not WOULDBLOCK. Problem solved.
Reply to:
- References:
- flock, FAGAIN, and FWOULDBLOCK
- From: Stefan Fritsch <sf@sfritsch.de>
- Re: flock, FAGAIN, and FWOULDBLOCK
- From: Kyle McMartin <kyle@infradead.org>
- Re: flock, FAGAIN, and FWOULDBLOCK
- From: Kyle McMartin <kyle@infradead.org>
- Re: flock, FAGAIN, and FWOULDBLOCK
- From: "Carlos O'Donell" <carlos@systemhalted.org>
- Re: flock, FAGAIN, and FWOULDBLOCK
- From: Matthew Wilcox <matthew@wil.cx>