1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

nptl: Change type of __default_pthread_attr

union pthread_attr_transparent has always the correct size, even if
pthread_attr_t has padding that is not present in struct pthread_attr.

This should not result in an observable behavioral change.  The
existing code appears to have been correct, but it was brittle because
it was not clear which functions were allowed to write to an entire
pthread_attr_t argument (e.g., by copying it).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Florian Weimer
2020-05-18 18:25:18 +02:00
parent 86ed0774cf
commit c2322a561f
8 changed files with 14 additions and 15 deletions

View File

@ -33,7 +33,7 @@ __pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize)
if (size == 0)
{
lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
size = __default_pthread_attr.stacksize;
size = __default_pthread_attr.internal.stacksize;
lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
}
*stacksize = size;