libc/include/sys/errno.h

J. Johnston jjohnstn@redhat.com
Thu Apr 24 14:37:00 GMT 2003



Christopher Faylor wrote:
> [removing cygwin-developers since that is a closed list]
> On Wed, Apr 23, 2003 at 12:02:20PM -0400, J. Johnston wrote:
> 
>>Unfortunately, the variable is not historically declared const.  If you
>>look at glibc, djgpp, and BSD, you will see that is declared as newlib
>>does.  Therefore, the declaration should be left as-is.
> 
> 
> Would you object to making this entirely controlled by a __CYGWIN__ ifdef/else,
> Jeff?
> 

I object to forking this for Cygwin just for convenience-sake.  I do not
know the background behind the problem.  Could you perhaps explain why Cygwin needs
to have this as const and why there isn't a reasonable alternative solution?

-- Jeff J.

> cgf
> 
> 
>>-- Jeff J.
>>
>>Earnie Boyd wrote:
>>
>>>ping.
>>>
>>>Adding cygwin-developers so that it can be discussed there if necessary.
>>>
>>>Earnie
>>>
>>>Earnie Boyd wrote:
>>>
>>>
>>>>Any reason that this change shouldn't happen?
>>>>
>>>>CGF, if this is accepted I can clean up the ugly hack in 
>>>>winsup/cygwin/errno.cc.
>>>>
>>>>Earnie.
>>>>
>>>>
>>>>------------------------------------------------------------------------
>>>>
>>>>2003-04-18  Earnie Boyd  <earnie@users.sf.net>
>>>>
>>>>   * include/sys/errno.h (_sys_nerr): Add _CONST modifier due to the 
>>>>fact
>>>>   that Cygwin uses it that way.
>>>>   (sys_nerr): Add const modifier.
>>>>
>>>>Index: errno.h
>>>>===================================================================
>>>>RCS file: /cvs/src/src/newlib/libc/include/sys/errno.h,v
>>>>retrieving revision 1.11
>>>>diff -u -3 -p -r1.11 errno.h
>>>>--- errno.h    24 Sep 2002 14:10:12 -0000    1.11
>>>>+++ errno.h    18 Apr 2003 13:18:56 -0000
>>>>@@ -18,10 +18,10 @@ extern int *__errno _PARAMS ((void));
>>>>/* Please don't use these variables directly.
>>>>   Use strerror instead. */
>>>>extern __IMPORT _CONST char * _CONST _sys_errlist[];
>>>>-extern __IMPORT int _sys_nerr;
>>>>+extern __IMPORT _CONST int _sys_nerr;
>>>>#ifdef __CYGWIN__
>>>>extern __IMPORT const char * const sys_errlist[];
>>>>-extern __IMPORT int sys_nerr;
>>>>+extern __IMPORT const int sys_nerr;
>>>>#endif
>>>>
>>>>#define __errno_r(ptr) ((ptr)->_errno)
>>>
>>>




More information about the Newlib mailing list