]> Git Repo - qemu.git/commitdiff
qemu-thread-posix: Fix build against older glibc version
authorJan Kiszka <[email protected]>
Tue, 11 Mar 2014 15:49:23 +0000 (16:49 +0100)
committerPeter Maydell <[email protected]>
Tue, 11 Mar 2014 18:19:21 +0000 (18:19 +0000)
pthread_setname_np was introduced with 2.12.

Signed-off-by: Jan Kiszka <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
util/qemu-thread-posix.c

index 45113b464d7a9ea876e6183de8ed6bd4ce5d5b7e..960d7f5d4280b50f95cedfef789474cc98fd2052 100644 (file)
@@ -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);
     }
This page took 0.026014 seconds and 4 git commands to generate.