This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Add test for pthread_setname_np and pthread_getname_np.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, OndÅej BÃlka <neleai at seznam dot cz>
- Date: Thu, 12 Dec 2013 00:50:36 -0500
- 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>
On 12/10/2013 10:27 AM, Torvald Riegel wrote:
> On Tue, 2013-12-10 at 01:07 -0500, Carlos O'Donell wrote:
>> I've had this kicking around since Ondrej added the manual
>> entry for these functions and we all agreed that they should
>> do nothing with NULL input.
>> This adds 4 test for pthread_setname_np and pthread_getname_np.
>> Test 1: Get the name of the task via pthread_getname_np and /proc
>> and verify that they both match.
>> Test 2: Test setting the name and then independently verify it
>> was set via /proc.
>> Test 3: Test setting a name that is one-byte too big and fails
>> with the correct error return *and* that the process
>> name is not modified.
>> Test 4: Verify that setting the longest name works.
>> Tested on x86-64 with no regressions.
>> [carlos@koi glibc]$ cat nptl/tst-setgetname.out
>> PASS: Test 1 - pthread_getname_np and /proc agree.
>> PASS: Test 2 - Value used in pthread_setname_np and /proc agree.
>> PASS: Test 3 - pthread_setname_np returned ERANGE for a process name that was too long.
>> PASS: Test 3 - Original name unchanged after pthread_setname_np returned ERANGE.
>> PASS: Test 4 - Longest name set via pthread_setname_np agrees with /proc.
>> OK to checkin?
> Looks good to me.
Thanks, I've checked this in.