Re: flock, FAGAIN, and FWOULDBLOCK

Geert Uytterhoeven
2009-02-23T08:23:53Z

On Mon, Feb 23, 2009 at 04:20, Michael Kerrisk
<mtk.manpages@googlemail.com> wrote:
> * Generally POSIX requires that each error name must have distinct
> associated value. EAGAIN and EWOULDBLOCK are one of the few
> exceptions: POSIX permits, but does not require, that these error
> constants have the same value. On most systems they of course do have
> the same value. HP-UX is the most notable exception.

And VxWorks (which is probably used more than HP-UX).

Causes interesting compiler problems when porting code from VxWorks to
Linux that has

case -EGAIN:
case -EWOULDBLOCK:

Oops, duplicate case value...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds