This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: Cygwin64: errno.h error values

Hi all,

Comparing errno.h from cygwin with the ones from mingw(-64) and VS10, the first
ones on the list have equal values, but later on values are diverging. I already
reported that to the mingw-w64 people, and they adapted the list making
it the same as VS10. See:

Cygwin apparently started with initial values of some early Visual
Studio, and added
the missing ones, using succeeding values. Having different values in Cygwin and
MS might cause unexpected problems: every time when transferring error-codes
between some MS dll and cygwin, proper translation must be done between the
two domains when the error-codes are different.

Wouldn't it be a lot easier when Cygwin started to use the same error-values
than Visual Studio? Then the mingw-w64 cross-compiler doesn't need its own
errno.h (or sys/errno.h) any more, the one from cygwin would work fine as well.
And mingw-w64 would not need constructs like:
    #ifndef EAFNOSUPPORT
    #define EAFNOSUPPORT 102
something they only do because of possible conflicting definitions in

Now that Cygwin64 is not officially released yet, I hope it is not too
late yet to
change this: I realize this is a binary incompatibility and all packages need
to be recompiled.

Here is a test program (main.c) which - when compiled with VS10+ -
just outputs "THE END". It can be used to test whether all errno
values are really the same as the ones from VS10+. I also included
a patch for sys/errno.h, which changes the errno values to be
the same as the values from Visual Studio.

           Jan Nijtmans

Attachment: errno.h.diff
Description: Binary data

#include <errno.h>
#include <stdio.h>
void main() {
    for (i = 0; i <= 40; i++) {
        if (a[i]!=100+i) printf("expected %d but was %d\n",100+i,a[i]);
    printf("THE END\n");
Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]