aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2014-03-12 11:48:18 +0000
committerMichael S. Tsirkin <mst@redhat.com>2014-03-27 17:48:11 +0200
commit5c312079417908381ffca44d18150b6a990c4f0b (patch)
tree7bfa5c082c733ea09edd056dde31d8ff04741c2d /configure
parentf7bc8ef8091229a4bec0e2a40af90abb8dcb3834 (diff)
Detect pthread_setname_np at configure time
Warn if no way of setting thread name is available. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure b/configure
index aae617e765..01e637f546 100755
--- a/configure
+++ b/configure
@@ -2696,6 +2696,24 @@ if test "$mingw32" != yes -a "$pthread" = no; then
"Make sure to have the pthread libs and headers installed."
fi
+# check for pthread_setname_np
+pthread_setname_np=no
+cat > $TMPC << EOF
+#include <pthread.h>
+
+static void *f(void *p) { return NULL; }
+int main(void)
+{
+ pthread_t thread;
+ pthread_create(&thread, 0, f, 0);
+ pthread_setname_np(thread, "QEMU");
+ return 0;
+}
+EOF
+if compile_prog "" "$pthread_lib" ; then
+ pthread_setname_np=yes
+fi
+
##########################################
# rbd probe
if test "$rbd" != "no" ; then
@@ -4628,6 +4646,16 @@ if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak
fi
+# Hold two types of flag:
+# CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on
+# a thread we have a handle to
+# CONFIG_PTHREAD_SETNAME_NP - A way of doing it on a particular
+# platform
+if test "$pthread_setname_np" = "yes" ; then
+ echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak
+ echo "CONFIG_PTHREAD_SETNAME_NP=y" >> $config_host_mak
+fi
+
if test "$tcg_interpreter" = "yes"; then
QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
elif test "$ARCH" = "sparc64" ; then