This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add test for pthread_setname_np and pthread_getname_np.
- From: Allan McRae <allan at archlinux dot org>
- To: Carlos O'Donell <carlos at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Wed, 05 Feb 2014 13:30:15 +1000
- Subject: Re: [PATCH] Add test for pthread_setname_np and pthread_getname_np.
- Authentication-results: sourceware.org; auth=none
- References: <52A6AF89 dot 6040903 at redhat dot com> <1386689266 dot 23049 dot 3227 dot camel at triegel dot csb> <52A94EAC dot 5020800 at redhat dot com> <52A957D3 dot 5090809 at redhat dot com> <52AF01B9 dot 4090601 at linux dot vnet dot ibm dot com> <52F064E6 dot 8020901 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1402041414581 dot 18044 at digraph dot polyomino dot org dot uk> <52F1ADD3 dot 50200 at redhat dot com>
On 05/02/14 13:19, Carlos O'Donell wrote:
> On 02/04/2014 09:18 AM, Joseph S. Myers wrote:
>> On Mon, 3 Feb 2014, Carlos O'Donell wrote:
>>
>>> diff --git a/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c b/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
>>> index 2aceba5..0235d37 100644
>>> --- a/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
>>> +++ b/nptl/sysdeps/unix/sysv/linux/tst-setgetname.c
>>> @@ -99,6 +99,17 @@ do_test (int argc, char **argv)
>>> if (res == 0)
>>> {
>>> res = get_self_comm (gettid (), name_check, TASK_COMM_LEN);
>>> +
>>> + /* 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;
>>> + }
>>
>> I'd like it to be obvious that this can be removed when we require kernel
>> 2.6.33 or later (maybe in a couple of years' time). Could you condition
>> this on __LINUX_KERNEL_VERSION < 0x020621, or (more cleanly) a
>> corresponding __ASSUME_PROC_PID_TASK_COMM defined in kernel-features.h for
>> __LINUX_KERNEL_VERSION >= 0x020621 (with an include of kernel-features.h
>> in this test, of course)?
>
> Allan,
>
> The Linux-specific test for pthread_setname_np and pthread_getname_np
> fails on systems running the Linux kernel 2.6.32 or older. The fix
> below makes us skip this test when the kernel is older than 2.6.33
> (when /proc/self/task/%lu/comm was added, which is required by the test).
>
> I'd like to check this in if you don't object to cleanup the testsuite
> for results for Adhemerval who is testing on systems with older kernels.
>
> Joseph,
>
> Absolutely. That's a great idea.
>
> Simulated testing by using invalid path and rebuilding with
> arch_minimum_kernel set to 2.6.33.
>
> Tested on x86-64 with no regressions.
>
> OK to checkin?
Yes,
Allan