errno.h: ESTRPIPE
Ralf Corsepius
ralf.corsepius@rtems.org
Tue Mar 17 03:00:00 GMT 2009
Jeff Johnston wrote:
> Ralf Corsepius wrote:
>> Christopher Faylor wrote:
>>> On Mon, Mar 16, 2009 at 08:29:26AM +0100, Ralf Corsepius wrote:
>>>
>>>> newlib should stay with well established standards and not be polluted
>>>> with underdocumented, proprietary extensions.
>>>>
>>>
>>> Do you have any other irrational prejudices you'd like to share with us?
>> No, simply point me to an official (POSIX, IEEE, ANSII or similar)
>> standard documenting ESTRPIPE.
>>
>> Ralf
>>
> Hi Ralf,
>
> According to Posix Section 2.4 states:
>
> "Implementations may support additional errors not listed in this
> clause, but shall not generate a different error number from one
> required by this part of ISO/IEC 9945 for an error condition described
> in this part of ISO/IEC 9945...."
>
> Similarly under SUSV:
>
> "Additional implementation-dependent error numbers may be defined in
> <errno.h>"
Well, this only applies from an OS's POV, i.e. an OS has the liberty to
add further errnos.
Newlib is in a special position wrt. this: It is not part of the OS
(glibc is), it is used by the OS.
I.e. what you are saying effectively means: Cygwin dictates to newlib
what other OS using newlib must support.
That's a serious problem.
> Finally, glibc contains a number of errno extensions and it includes
> ESTRPIPE. Newlib often adopts glibc extensions as requested in the
> interest of making it easier to port code to newlib.
My view is converse: newlib adopts everything, to make packages which
rely on non-portable constructs workable, instead of encouraging
developers to make those applications portable.
> That said, if RTEMS absolutely doesn't want any of these extensions
> there are two alternatives. 1. Simply write a sys/errno.h file with
> only standard-provided errno values.
Why should we do so? It's Cygwin who wishes to use extensions, RTEMS has
no use for.
> If only standard-provided errnos
> plus RTEMS extensions are to be supported, this makes the most sense as
> you don't really require a common file and it will likely rarely require
> maintenance. 2. Add flag checks to sys/errno.h that segregate the
> extensions and only remove them if the flag is defined (by default all
> are provided). For example, __NO_ERRNO_EXTENSIONS__.
>
> Seem reasonable?
I am not convinced: Why no #ifdef __CYGWIN__?
It's _Cygwin_, who wishes to add _its_ extended errnos - I think, I
should add RTEMS's error codes to newlib. May-be you'll then understand
why I am opposed to this ESTRIPE addition?
Ralf
More information about the Newlib
mailing list