public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Fwd: Cygwin64: errno.h error values
@ 2013-05-03  7:22 Jan Nijtmans
  2013-05-03  7:34 ` Kai Tietz
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Nijtmans @ 2013-05-03  7:22 UTC (permalink / raw)
  To: cygwin

2013/5/3 Christopher Faylor:
> We make ABSOLUTELY no guarantees that our errnos will match any other
> system's.  You can't expect that you will be able to use Cygwin errno's
> in pure Windows applications.  We really don't care if our errnos match
> those of Windows.  Sorry.

No need for a sorry. I understand. I just felt obliged to report it, because in
the (unlikely) case that such a problem arises a major release is the
only moment that such a thing can be fixed. This would be a chance
to have a single errno.h shared by mingw, mingw-w64, wine and cygwin
(which would then be a superset of Microsoft's).

The mingw-w64 cross-compiler in Cygwin64 (x64_64-w64-mingw32)
is currently lacking "errno.h", I would expect it in:
   /usr/x86_64-w64-mingw32/sys-root/mingw/include/errno.h
In Cygwin32 it's fine, "errno.h" is where I would expect it.
This makes the cross-compiler unusable at the moment for
me in Cygwin64, but in Cygwin32 it works fine.

Thanks for all the work on Cygwin64. I have it in a pretty useful
state now!

Regards,
         Jan Nijtmans

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cygwin64: errno.h error values
  2013-05-03  7:22 Fwd: Cygwin64: errno.h error values Jan Nijtmans
@ 2013-05-03  7:34 ` Kai Tietz
  0 siblings, 0 replies; 4+ messages in thread
From: Kai Tietz @ 2013-05-03  7:34 UTC (permalink / raw)
  To: cygwin

2013/5/3 Jan Nijtmans wrote:
> 2013/5/3 Christopher Faylor:
>> We make ABSOLUTELY no guarantees that our errnos will match any other
>> system's.  You can't expect that you will be able to use Cygwin errno's
>> in pure Windows applications.  We really don't care if our errnos match
>> those of Windows.  Sorry.
>
> No need for a sorry. I understand. I just felt obliged to report it, because in
> the (unlikely) case that such a problem arises a major release is the
> only moment that such a thing can be fixed. This would be a chance
> to have a single errno.h shared by mingw, mingw-w64, wine and cygwin
> (which would then be a superset of Microsoft's).
>
> The mingw-w64 cross-compiler in Cygwin64 (x64_64-w64-mingw32)
> is currently lacking "errno.h",
Absoultely an absurdity.  Of course mingw-w64 provides an errno.h
header.  Not sure where you expect headers are and what content by
your expectations they shall have, but I would recomment that you
might try before starting to do fural guessings.

Regards,
Kai

PS: The native toolchain and cygwin don't share most of the
C-runtime-headers by good reasons.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: Cygwin64: errno.h error values
  2013-05-02 20:14 ` Fwd: " Jan Nijtmans
@ 2013-05-03  1:14   ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2013-05-03  1:14 UTC (permalink / raw)
  To: cygwin

On Thu, May 02, 2013 at 10:14:33PM +0200, Jan Nijtmans wrote:
>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:
>    <http://sourceforge.net/tracker/?func=detail&atid=983354&aid=3448042&group_id=202880>
>
>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.

We make ABSOLUTELY no guarantees that our errnos will match any other
system's.  You can't expect that you will be able to use Cygwin errno's
in pure Windows applications.  We really don't care if our errnos match
those of Windows.  Sorry.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Fwd: Cygwin64: errno.h error values
       [not found] <CAO1jNwt9oiarAt5A3Stn46b-shTFTwgCm0kioxjiHt_j1u-uww@mail.gmail.com>
@ 2013-05-02 20:14 ` Jan Nijtmans
  2013-05-03  1:14   ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Nijtmans @ 2013-05-02 20:14 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

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:
    <http://sourceforge.net/tracker/?func=detail&atid=983354&aid=3448042&group_id=202880>

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
    #endif
something they only do because of possible conflicting definitions in
mingw/cygwin.

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.

Regards,
           Jan Nijtmans

[-- Attachment #2: errno.h.diff --]
[-- Type: application/octet-stream, Size: 8796 bytes --]

--- sys/errno.h.orig	2013-04-24 14:29:20.000000000 +0200
+++ sys/errno.h	2013-05-02 11:29:44.174433500 +0200
@@ -55,7 +55,7 @@
 #define	ENFILE 23	/* Too many open files in system */
 #define	EMFILE 24	/* Too many open files */
 #define	ENOTTY 25	/* Not a typewriter */
-#define	ETXTBSY 26	/* Text file busy */
+#define	ETXTBSY 139	/* Text file busy */
 #define	EFBIG 27	/* File too large */
 #define	ENOSPC 28	/* No space left on device */
 #define	ESPIPE 29	/* Illegal seek */
@@ -64,20 +64,20 @@
 #define	EPIPE 32	/* Broken pipe */
 #define	EDOM 33		/* Math arg out of domain of func */
 #define	ERANGE 34	/* Math result not representable */
-#define	ENOMSG 35	/* No message of desired type */
-#define	EIDRM 36	/* Identifier removed */
+#define	ENOMSG 122	/* No message of desired type */
+#define	EIDRM 111	/* Identifier removed */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define	ECHRNG 37	/* Channel number out of range */
-#define	EL2NSYNC 38	/* Level 2 not synchronized */
-#define	EL3HLT 39	/* Level 3 halted */
-#define	EL3RST 40	/* Level 3 reset */
-#define	ELNRNG 41	/* Link number out of range */
-#define	EUNATCH 42	/* Protocol driver not attached */
+#define	EL2NSYNC 91	/* Level 2 not synchronized */
+#define	EL3HLT 46	/* Level 3 halted */
+#define	EL3RST 88	/* Level 3 reset */
+#define	ELNRNG 90	/* Link number out of range */
+#define	EUNATCH 35	/* Protocol driver not attached */
 #define	ENOCSI 43	/* No CSI structure available */
 #define	EL2HLT 44	/* Level 2 halted */
 #endif
-#define	EDEADLK 45	/* Deadlock condition */
-#define	ENOLCK 46	/* No record locks available */
+#define	EDEADLK 36	/* Deadlock condition */
+#define	ENOLCK 39	/* No record locks available */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define EBADE 50	/* Invalid exchange */
 #define EBADR 51	/* Invalid request descriptor */
@@ -85,31 +85,31 @@
 #define ENOANO 53	/* No anode */
 #define EBADRQC 54	/* Invalid request code */
 #define EBADSLT 55	/* Invalid slot */
-#define EDEADLOCK 56	/* File locking deadlock error */
+#define EDEADLOCK EDEADLK	/* File locking deadlock error */
 #define EBFONT 57	/* Bad font file fmt */
 #endif
-#define ENOSTR 60	/* Device not a stream */
-#define ENODATA 61	/* No data (for no delay io) */
-#define ETIME 62	/* Timer expired */
-#define ENOSR 63	/* Out of streams resources */
+#define ENOSTR 125	/* Device not a stream */
+#define ENODATA 120	/* No data (for no delay io) */
+#define ETIME 137	/* Timer expired */
+#define ENOSR 124	/* Out of streams resources */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define ENONET 64	/* Machine is not on the network */
 #define ENOPKG 65	/* Package not installed */
 #define EREMOTE 66	/* The object is remote */
 #endif
-#define ENOLINK 67	/* The link has been severed */
+#define ENOLINK 121	/* The link has been severed */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define EADV 68		/* Advertise error */
 #define ESRMNT 69	/* Srmount error */
 #define	ECOMM 70	/* Communication error on send */
 #endif
-#define EPROTO 71	/* Protocol error */
+#define EPROTO 134	/* Protocol error */
 #define	EMULTIHOP 74	/* Multihop attempted */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define	ELBIN 75	/* Inode is remote (not really error) */
 #define	EDOTDOT 76	/* Cross mount point (not really error) */
 #endif
-#define EBADMSG 77	/* Trying to read unreadable message */
+#define EBADMSG 104	/* Trying to read unreadable message */
 #define EFTYPE 79	/* Inappropriate file type or format */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define ENOTUNIQ 80	/* Given log. name not unique */
@@ -121,68 +121,68 @@
 #define ELIBMAX 86	/* Attempting to link in too many libs */
 #define ELIBEXEC 87	/* Attempting to exec a shared library */
 #endif
-#define ENOSYS 88	/* Function not implemented */
+#define ENOSYS 40	/* Function not implemented */
 #ifdef __CYGWIN__
 #define ENMFILE 89      /* No more files */
 #endif
-#define ENOTEMPTY 90	/* Directory not empty */
-#define ENAMETOOLONG 91	/* File or path name too long */
-#define ELOOP 92	/* Too many symbolic links */
-#define EOPNOTSUPP 95	/* Operation not supported on transport endpoint */
+#define ENOTEMPTY 41	/* Directory not empty */
+#define ENAMETOOLONG 38	/* File or path name too long */
+#define ELOOP 114	/* Too many symbolic links */
+#define EOPNOTSUPP 130	/* Operation not supported on transport endpoint */
 #define EPFNOSUPPORT 96 /* Protocol family not supported */
-#define ECONNRESET 104  /* Connection reset by peer */
-#define ENOBUFS 105	/* No buffer space available */
-#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
-#define EPROTOTYPE 107	/* Protocol wrong type for socket */
-#define ENOTSOCK 108	/* Socket operation on non-socket */
-#define ENOPROTOOPT 109	/* Protocol not available */
-#ifdef __LINUX_ERRNO_EXTENSIONS__
-#define ESHUTDOWN 110	/* Can't send after socket shutdown */
-#endif
-#define ECONNREFUSED 111	/* Connection refused */
-#define EADDRINUSE 112		/* Address already in use */
-#define ECONNABORTED 113	/* Connection aborted */
-#define ENETUNREACH 114		/* Network is unreachable */
-#define ENETDOWN 115		/* Network interface is not configured */
-#define ETIMEDOUT 116		/* Connection timed out */
-#define EHOSTDOWN 117		/* Host is down */
-#define EHOSTUNREACH 118	/* Host is unreachable */
-#define EINPROGRESS 119		/* Connection already in progress */
-#define EALREADY 120		/* Socket already connected */
-#define EDESTADDRREQ 121	/* Destination address required */
-#define EMSGSIZE 122		/* Message too long */
-#define EPROTONOSUPPORT 123	/* Unknown protocol */
-#ifdef __LINUX_ERRNO_EXTENSIONS__
-#define ESOCKTNOSUPPORT 124	/* Socket type not supported */
-#endif
-#define EADDRNOTAVAIL 125	/* Address not available */
-#define ENETRESET 126
-#define EISCONN 127		/* Socket is already connected */
-#define ENOTCONN 128		/* Socket is not connected */
-#define ETOOMANYREFS 129
+#define ECONNRESET 108  /* Connection reset by peer */
+#define ENOBUFS 119	/* No buffer space available */
+#define EAFNOSUPPORT 102 /* Address family not supported by protocol family */
+#define EPROTOTYPE 136	/* Protocol wrong type for socket */
+#define ENOTSOCK 128	/* Socket operation on non-socket */
+#define ENOPROTOOPT 123	/* Protocol not available */
+#ifdef __LINUX_ERRNO_EXTENSIONS__
+#define ESHUTDOWN 92	/* Can't send after socket shutdown */
+#endif
+#define ECONNREFUSED 107	/* Connection refused */
+#define EADDRINUSE 100		/* Address already in use */
+#define ECONNABORTED 106	/* Connection aborted */
+#define ENETUNREACH 118		/* Network is unreachable */
+#define ENETDOWN 116		/* Network interface is not configured */
+#define ETIMEDOUT 138		/* Connection timed out */
+#define EHOSTDOWN 77		/* Host is down */
+#define EHOSTUNREACH 110	/* Host is unreachable */
+#define EINPROGRESS 112		/* Connection already in progress */
+#define EALREADY 103		/* Socket already connected */
+#define EDESTADDRREQ 109	/* Destination address required */
+#define EMSGSIZE 115		/* Message too long */
+#define EPROTONOSUPPORT 135	/* Unknown protocol */
+#ifdef __LINUX_ERRNO_EXTENSIONS__
+#define ESOCKTNOSUPPORT 63	/* Socket type not supported */
+#endif
+#define EADDRNOTAVAIL 101	/* Address not available */
+#define ENETRESET 117
+#define EISCONN 113		/* Socket is already connected */
+#define ENOTCONN 126		/* Socket is not connected */
+#define ETOOMANYREFS 71
 #ifdef __LINUX_ERRNO_EXTENSIONS__
-#define EPROCLIM 130
+#define EPROCLIM 95
 #define EUSERS 131
 #endif
-#define EDQUOT 132
-#define ESTALE 133
-#define ENOTSUP 134		/* Not supported */
+#define EDQUOT 26
+#define ESTALE 142
+#define ENOTSUP 129		/* Not supported */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
-#define ENOMEDIUM 135   /* No medium (in tape drive) */
+#define ENOMEDIUM 67   /* No medium (in tape drive) */
 #endif
 #ifdef __CYGWIN__
-#define ENOSHARE 136    /* No such host or network path */
-#define ECASECLASH 137  /* Filename exists with different case */
+#define ENOSHARE 45    /* No such host or network path */
+#define ECASECLASH 62  /* Filename exists with different case */
 #endif
-#define EILSEQ 138
-#define EOVERFLOW 139	/* Value too large for defined data type */
-#define ECANCELED 140	/* Operation canceled */
-#define ENOTRECOVERABLE 141	/* State not recoverable */
-#define EOWNERDEAD 142	/* Previous owner died */
+#define EILSEQ 42
+#define EOVERFLOW 132	/* Value too large for defined data type */
+#define ECANCELED 105	/* Operation canceled */
+#define ENOTRECOVERABLE 127	/* State not recoverable */
+#define EOWNERDEAD 133	/* Previous owner died */
 #ifdef __LINUX_ERRNO_EXTENSIONS__
 #define ESTRPIPE 143	/* Streams pipe error */
 #endif
-#define EWOULDBLOCK EAGAIN	/* Operation would block */
+#define EWOULDBLOCK 140	/* Operation would block */
 
 #define __ELASTERROR 2000	/* Users can add values starting here */
 

[-- Attachment #3: main.c --]
[-- Type: text/x-csrc, Size: 668 bytes --]

#include <errno.h>
#include <stdio.h>
void main() {
    int i, a[] = {EADDRINUSE,EADDRNOTAVAIL,EAFNOSUPPORT,EALREADY,EBADMSG,
        ECANCELED,ECONNABORTED,ECONNREFUSED,ECONNRESET,EDESTADDRREQ,
        EHOSTUNREACH,EIDRM,EINPROGRESS,EISCONN,ELOOP, EMSGSIZE,ENETDOWN,
        ENETRESET,ENETUNREACH,ENOBUFS,ENODATA,ENOLINK,ENOMSG,ENOPROTOOPT,
        ENOSR,ENOSTR,ENOTCONN,ENOTRECOVERABLE,ENOTSOCK,ENOTSUP,EOPNOTSUPP,
        131,EOVERFLOW,EOWNERDEAD,EPROTO,EPROTONOSUPPORT,EPROTOTYPE,ETIME,
        ETIMEDOUT,ETXTBSY,EWOULDBLOCK};
    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");
}

[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-03  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03  7:22 Fwd: Cygwin64: errno.h error values Jan Nijtmans
2013-05-03  7:34 ` Kai Tietz
     [not found] <CAO1jNwt9oiarAt5A3Stn46b-shTFTwgCm0kioxjiHt_j1u-uww@mail.gmail.com>
2013-05-02 20:14 ` Fwd: " Jan Nijtmans
2013-05-03  1:14   ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).