about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/tst-setgetname.c14
2 files changed, 20 insertions, 0 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 8761f5be9b..003e290bb1 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-05  Carlos O'Donell  <carlos@redhat.com>
+
+	* sysdeps/unix/sysv/linux/tst-setgetname.c (do_test): Skip the
+	test if !__ASSUME_PROC_PID_TASK_COMM and get_self_comm returns
+	ENOENT.
+
 2014-01-23  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
 	* tst-tls7.c: Adjust testcase timeout
diff --git a/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c b/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
index 2aceba53bc..f5693e26c4 100644
--- a/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
+++ b/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
@@ -23,6 +23,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <kernel-features.h>
 
 /* New name of process.  */
 #define NEW_NAME "setname"
@@ -99,6 +100,19 @@ do_test (int argc, char **argv)
   if (res == 0)
     {
       res = get_self_comm (gettid (), name_check, TASK_COMM_LEN);
+
+#if !__ASSUME_PROC_PID_TASK_COMM
+      /* On this first test we look for ENOENT to be returned from
+         get_self_comm to indicate that the kernel is older than
+         2.6.33 and doesn't contain comm within the proc structure.
+         In that case we skip the entire test.  */
+      if (res == ENOENT)
+	{
+	  printf ("SKIP: The kernel does not have /proc/self/task/%%lu/comm.\n");
+	  return 0;
+	}
+#endif
+
       if (res == 0)
        {
          if (strncmp (name, name_check, strlen (BIG_NAME)) == 0)