errno.h: ESTRPIPE

Peter Rosin peda@axentia.se
Fri Mar 13 19:48:00 GMT 2009


Warren Young skrev:
> Corinna Vinschen wrote:
> > This is very Linux device specific and this never occurs on Cygwin.
> > What about just defining this error code to some arbitrary 
> value like
> > 
> >   #ifdef __CYGWIN__
> >   #define ESTRPIPE 9999
> >   #endif
> 
> I like it.  If there are any other errno constants supported by Linux 
> but not Cygwin, you could also define them with the same value.  It 
> would effectively be the "this never happens" value.

That a bad suggestion.

Consider code like this:

switch (errno) {
case -ESTRPIPE:
	capers();
	break;
case -EFOOBAR:
	cucumber();
	break;
}

If both ESTRPIPE and EFOOBAR are defined to 9999 that doesn't work too
well, and you end up having cygwin specific patches in any case.

Cheers,
Peter



More information about the Cygwin-patches mailing list