This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add test for pthread_setname_np and pthread_getname_np.


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.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]