nptl: PTHREAD_COND_INITIALIZER compatibility with pre-2.41 versions (bug 32786)

[BZ #25847]

The new initializer and struct layout does not initialize the
__g_signals field in the old struct layout before the change in
commit c36fc50781 ("nptl: Remove
g_refs from condition variables").  Bring back fields at the end
of struct __pthread_cond_s, so that they are again zero-initialized.

(cherry picked from commit dbc5a50d12)

Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Florian Weimer 2025-07-11 05:57:50 -07:00 committed by Carlos O'Donell
parent 39a80f4035
commit 51210d6496
2 changed files with 3 additions and 1 deletions

View File

@ -99,6 +99,8 @@ struct __pthread_cond_s
unsigned int __g1_orig_size; unsigned int __g1_orig_size;
unsigned int __wrefs; unsigned int __wrefs;
unsigned int __g_signals[2]; unsigned int __g_signals[2];
unsigned int __unused_initialized_1;
unsigned int __unused_initialized_2;
}; };
typedef unsigned int __tss_t; typedef unsigned int __tss_t;

View File

@ -152,7 +152,7 @@ enum
/* Conditional variable handling. */ /* Conditional variable handling. */
#define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0} } } #define PTHREAD_COND_INITIALIZER { { {0}, {0}, {0, 0}, 0, 0, {0, 0}, 0, 0 } }
/* Cleanup buffers */ /* Cleanup buffers */