New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strerror() or strerror_r() instead of sys_errlist and sys_nerr #1830
Comments
|
To fix the error on GNU/Hurd, we should probably add a check for sys_errlist in the configure script. |
Thanks @gnu-srs. In case you are referring to my comment on Debian bug 771052, I'm not the Debian maintainer but one of the upstream committers. I see there is some confusion between async-safe and thread-safe on 771052 (see also #495 and fish's Fork and Pthread Manifesto). On the downstream bug, Samuel Thibault notes that
although it is not clear that this is definitely async-safe. There is lots of |
What are the options if there is no |
The nginx project has also run into this problem, and have solved it by... setting up their own internal |
That's wild |
To confirm, glibc is definitely not async-safe: Solaris doesn't have The nginx implementation is starting to look alarmingly sane. |
Solaris uses |
libiberty, which comes with GCC, does something fairly similar to ngnix: https://github.com/gcc-mirror/gcc/blob/master/libiberty/strerror.c |
In 147078f there is a check for |
Hi,
Looks like your code is still using sys_errlist and sys_nerr for error messages on non-UCLIBC systems instead of strerror(). It has been specified by POSIX.1-2001, POSIX.1-2008, C89, and C99.
Why so, e.g. even GNU/Linux marks them as obsolete even if found:
/usr/include/x86_64-linux-gnu/bits/sys_errlist.h
/* sys_errlist and sys_nerr are deprecated. Use strerror instead. */
On GNU/Hurd they are not defined, therefore fish fails to build from source there. In case you want a thread-safe version of strerror(), why not use strerror_r(), as specified by POSIX.1-2001 and POSIX.1-2008.
Seems like the Debian maintainer is not comfortable with that change non-upstream.
Thanks!
The text was updated successfully, but these errors were encountered: