Use strerror_r in safe_strerror if available
authorChristian Biesinger <cbiesinger@google.com>
Thu, 31 Oct 2019 19:41:19 +0000 (14:41 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Thu, 31 Oct 2019 20:14:14 +0000 (15:14 -0500)
commitb231e86ac9608056ea837e24d42a878927f5787a
tree29b98002638e43c04d5a02a23501ea717932c750
parenta2726d4ff80168a8134c68cb798e3f5f537b0eba
Use strerror_r in safe_strerror if available

Also stores the result in a thread-local static variable and
changes the return value to a const char*.

This is already important because Guile creates threads and
Python can create threads, but with the patch series here:
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/176
GDB itself will create threads, too.

gdb/ChangeLog:

2019-10-31  Christian Biesinger  <cbiesinger@google.com>

* configure: Regenerate.
* configure.ac: Check for strerror_r.
* gdbsupport/common-utils.h (safe_strerror): Change return value
to const char * and document that this function is now threadsafe.
* gdbsupport/posix-strerror.c (safe_strerror): Make buf
thread_local and call strerror_r, if available.
* utils.c (perror_string): Update.
(print_sys_errmsg): Update.

Change-Id: I81048fbaf148035c221c528727f7efe58ba528eb
gdb/ChangeLog
gdb/configure
gdb/configure.ac
gdb/gdbsupport/common-utils.h
gdb/gdbsupport/posix-strerror.c
gdb/utils.c
This page took 0.027652 seconds and 4 git commands to generate.