tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: strerror(0) POSIX compliance
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 24.03.2016 12:49, Kamil Rytarowski wrote:
> POSIX extension to ISO C says:
>
> [CX] [Option Start] If the value of errnum is a valid error
> number, the message string shall indicate what error occurred; if
> the value of errnum is zero, the message string shall either be an
> empty string or indicate that no error occurred; otherwise, if
> these functions complete successfully, the message string shall
> indicate that an unknown error occurred. [Option End]
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.htm
l
>
> Currently we hardcode the following text: "Undefined error: 0",
> /* 0 - ENOERROR */
>
> -- src/lib/libc/compat/gen/compat_errlist.c
>
> gnulib check for strerror(0) POSIX compliance and it prohibits
> "ndefined" string.
>
> http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=tests/test-s
tr
>
>
error.c#l63
>
> Can we change this string to "No error" indicating that there is
> no error? GNU returns "Success".
>
Also could we add an entry ENOERROR in sys/errno.h as an extension and
for consistency. The ENOERROR value is mentioned in the code-base at
least twice.
#define ENOERROR 0 /* No error */
AFAIR Tru64 defines for 0 symbol EOK.
I discovered lack of EOK equivalent symbol while porting AdvFS. I used
there "0".
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJW89akAAoJEEuzCOmwLnZsfgoP/2j3v0QOd7zYj8Um7yVv4WE9
fbT50lOI4gmO3B1BlFDTaIbqOCST4vLfYUD/S1sWYRfUMKUlS9JZBcaK0P2iiL1Q
GURh1lFuqebrHxuag2ATMbY80T8QJsZMDRfuAnvoU9fW1kob5fA2PaVc1cBfvV9M
YxRGHI/Kgoz6X/rwYvWe7EypT6UshfifGAlRdLobQS5dCZVlJ0ceVLoV3gWzE6Zt
zfIhNkl8khaFucunIe0yB0KypgZejDS+f8q1mS87onF9l0063ZtkC6WHdA1I7jLy
tnSSYZt2HZSc8AchxBqHJbe6B8/nFLkfk/P1SKmlOaNBMS5neKrmyLFSMZskX2KQ
QxY6VRqIJCmT+u742RNvlv377Yen1fFv95hcLKUV6hQDVaxbDgpwb2SFpVQY3Hw+
hy15zpmIsZ420iMfkLW4krpGrU6BpZKXuO29T5N2IKNj3pP3TmRmNyn0MYXWQvbj
a9EYZ8OIz3ZCwcAzPJkqRpn3+n/dI92ztUbCjPTGQJ4vviE/fXoPrmGgG4aBaNwF
rF9ihlCxq5QtCFIM2/VJu61FOjx3o7DKK0jHSuJDpLAN53sq+iRcYa+3KlMSJUEm
O6vx9oOP9W7cvpdLJXdXWOX2KTsI3H3kD4QGItAomZ37zvcLxnYYrWdZPAiJ+EU9
GfIEpzCMCNDxeit7X1kj
=kJMn
-----END PGP SIGNATURE-----
Home |
Main Index |
Thread Index |
Old Index