aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2014-03-11 16:49:23 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-03-11 18:19:21 +0000
commit01207d0b78208c2f49c3f457d6794eea215d5be7 (patch)
tree7ceea557132ee566ee9a2e9496d0c94ac6369c55 /util
parent0ca540dbaea142ec5c3e7a1d12db7139b8317f37 (diff)
qemu-thread-posix: Fix build against older glibc version
pthread_setname_np was introduced with 2.12. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-thread-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 45113b464d..960d7f5d42 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -420,7 +420,7 @@ void qemu_thread_create(QemuThread *thread, const char *name,
if (err)
error_exit(err, __func__);
-#ifdef _GNU_SOURCE
+#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
if (name_threads) {
pthread_setname_np(thread->thread, name);
}