posix: Use 'char' for posix_condattr bitfields

Ensure that posix_condattr is smaller than pthread_condattr by keeping it
under one byte.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2025-05-12 10:44:29 -04:00 committed by Henrik Brix Andersen
commit 34a03fb436

View file

@ -68,10 +68,10 @@ struct posix_thread {
struct posix_condattr { struct posix_condattr {
/* leaves room for CLOCK_REALTIME (1, default) and CLOCK_MONOTONIC (4) */ /* leaves room for CLOCK_REALTIME (1, default) and CLOCK_MONOTONIC (4) */
unsigned int clock: 3; unsigned char clock: 3;
bool initialized: 1; char initialized: 1;
#ifdef _POSIX_THREAD_PROCESS_SHARED #ifdef _POSIX_THREAD_PROCESS_SHARED
unsigned int pshared: 1; unsigned char pshared: 1;
#endif #endif
}; };