diff options
author | Carlos O'Donell <carlos@redhat.com> | 2014-02-05 10:10:34 -0500 |
---|---|---|
committer | Carlos O'Donell <carlos@redhat.com> | 2014-02-05 10:13:11 -0500 |
commit | f877c4f2bf2ebc9ecd3e099e33fc4184f4fcac1a (patch) | |
tree | eb68704bb5ec948aff734d878e74cfccd056562d /nptl/sysdeps | |
parent | cff469ca41181c67e805eaf7c0a1b518b60fbf10 (diff) | |
download | glibc-f877c4f2bf2ebc9ecd3e099e33fc4184f4fcac1a.tar.gz glibc-f877c4f2bf2ebc9ecd3e099e33fc4184f4fcac1a.tar.xz glibc-f877c4f2bf2ebc9ecd3e099e33fc4184f4fcac1a.zip |
Fix tst-setgetname for Linux kernels < 2.6.33.
Support for /proc/self/task/$tid/comm as added in Linux 2.6.33, therefore since the test tst-setgetname relies on this functionality to operate we must skip the test in kernels < 2.6.33. We wrap the checks with __ASSUME_PROC_PID_TASK_COMM such that in the future when we move arch_minimum_kernel to 2.6.33 we can remove this code.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/tst-setgetname.c | 14 |
1 files changed, 14 insertions, 0 deletions
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) |