diff --git a/NEWS b/NEWS
index 185fe71fcbbca25521a69331eedabce7cb6f442e..8c73dd78dfaeb921509d3a3fcab48a062cb76c5a 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ documents those changes that are of interest to users and administrators.
     BurstBufferStageIn later in the scheduling logic.
  -- Document which srun options apply to only job, only step, or job and step
     allocations.
+ -- Use more compatible function to get thread name (>= 2.6.11).
 
 * Changes in Slurm 16.05.1
 ==========================
diff --git a/auxdir/x_ac_databases.m4 b/auxdir/x_ac_databases.m4
index 0779dc9c17666fb78224159e52bd472abb8a8957..e1390db4a4f2b103826e35d2363c52bfd960af13 100644
--- a/auxdir/x_ac_databases.m4
+++ b/auxdir/x_ac_databases.m4
@@ -18,7 +18,7 @@ AC_DEFUN([X_AC_DATABASES],
 	AC_ARG_WITH(
 		[mysql_config],
 		AS_HELP_STRING(--with-mysql_config=PATH,
-			Specify path to mysql_config binary),
+			Specify path of directory where mysql_config binary exists),
 		[_x_ac_mysql_bin="$withval"])
 
 	if test x$_x_ac_mysql_bin = xno; then
diff --git a/config.h.in b/config.h.in
index bda9087260373eecf09a377dc790fe6c8f10e238..aa6d625e5eed905b70428ee3964be92ddcb7ee54 100644
--- a/config.h.in
+++ b/config.h.in
@@ -24,9 +24,6 @@
 /* Define to 1 if using glib-2.32.0 or higher */
 #undef GLIB_NEW_THREADS
 
-/* Define to 1 if using glib-2.12.0 or higher */
-#undef GLIB_PTHREAD_GETNAME
-
 /* Define to 1 if licensed under terms of the GNU General Public License. */
 #undef GPL_LICENSED
 
diff --git a/configure b/configure
index 792faefb0359fd230e8552389e731663cb578ab5..ffc4093cb0f0f7ca8d907b10f033481cdf9aadc9 100755
--- a/configure
+++ b/configure
@@ -1778,7 +1778,8 @@ Optional Packages:
   --with-freeipmi=PATH    Specify path to freeipmi installation
   --with-rrdtool=PATH     Specify path to rrdtool-devel installation
   --with-mysql_config=PATH
-                          Specify path to mysql_config binary
+                          Specify path of directory where mysql_config binary
+                          exists
   --with-alps-emulation   Run SLURM against an emulated ALPS system - requires
                           option cray.conf [default=no]
   --with-cray_dir=PATH    Specify path to Cray file installation - /opt/cray
@@ -19935,10 +19936,9 @@ char *malloc ();
 int
 main ()
 {
-char *a = malloc(0);
-int b = !a;
-free(a);
-return b;
+return ! malloc (0);
+  ;
+  return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -22432,12 +22432,6 @@ rm -f core conftest.err conftest.$ac_objext \
   rm -f conf.glibtest
 
 
-if test ${glib_config_minor_version=0} -ge 12 ; then
-
-$as_echo "#define GLIB_PTHREAD_GETNAME 1" >>confdefs.h
-
-fi
-
 if test ${glib_config_minor_version=0} -ge 32 ; then
 
 $as_echo "#define GLIB_NEW_THREADS 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index 43deb44c073d2ee0303c5a6054df1802b7308839..a8ee7d074690aa1813deee31f90167daf094dabd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,10 +263,6 @@ fi
 
 AM_PATH_GLIB_2_0([2.7.1], [ac_glib_test="yes"], [ac_glib_test="no"], [gthread])
 
-if test ${glib_config_minor_version=0} -ge 12 ; then
-       AC_DEFINE([GLIB_PTHREAD_GETNAME], 1, [Define to 1 if using glib-2.12.0 or higher])
-fi
-
 if test ${glib_config_minor_version=0} -ge 32 ; then
        AC_DEFINE([GLIB_NEW_THREADS], 1, [Define to 1 if using glib-2.32.0 or higher])
 fi
diff --git a/src/common/log.c b/src/common/log.c
index eefae9f15fd31c468e3edbb93ffb37102a14f829..3e4efcc95d545858c53c335dcbcf93905a7baeb9 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -52,6 +52,10 @@
 
 #include "config.h"
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include <errno.h>
 #include <poll.h>
 #include <pthread.h>
@@ -664,14 +668,14 @@ set_idbuf(char *idbuf)
 	int max_len = 12; /* handles current longest thread name */
 
 	gettimeofday(&now, NULL);
-#ifdef GLIB_PTHREAD_GETNAME
-	if (pthread_getname_np(pthread_self(), thread_name, NAMELEN)) {
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_GET_NAME, thread_name, NULL, NULL, NULL) < 0) {
 		error("failed to get thread name: %m");
-		return;
+		max_len = 0;
+		thread_name[0] = '\0';
 	}
 #else
-	/* pthread_getname_np is a non-standard extension
-	 * skip printing thread name if not available */
+	/* skip printing thread name if not available */
 	max_len = 0;
 	thread_name[0] = '\0';
 #endif