This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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]

Re: errno.h changes to mark Linux specific errnos


Corinna Vinschen wrote:
On Jul 7 14:10, Joel Sherrill wrote:
Hi,

In trying to build RTEMS with the newlib CVS head,
I noticed that the following errno's are used by
the BSD TCP/IP stack in RTEMS:

#define EBADRQC 54    /* Invalid request code */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define EHOSTDOWN 117        /* Host is down */
#define ETOOMANYREFS 129

So they are not only specific to Linux.  I changed the
conditional protecting each of these defines to

#if defined(__LINUX_ERRNO_EXTENSIONS__) || defined(__rtems__)

Is this the right solution? Any better ideas?

Cygwin also uses these errno values. In case of Cygwin, __LINUX_ERRNO_EXTENSIONS__ is simply defined in include/sys/config.h:

  #if defined(__CYGWIN__)
  #include <cygwin/config.h>
  #define __LINUX_ERRNO_EXTENSIONS__ 1
  #define _MB_EXTENDED_CHARSETS_ALL 1
  #endif

I'm glad you popped up Corinna.  I was worried that
Cygwin would suffer from this problem also.

If Cygwin has to enable them and RTEMS has them from BSD code,
then they aren't Linux specific are they?

Maybe the macro is misnamed and you almost always want these
enabled.


FWIW The GNU Ada run-time actually needed a couple turned
on because it assumed they were defined.

--joel
Corinna



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