From 7f42a9fb208048ab4f32d38f43da7c92c657b39a Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Wed, 8 Jul 2026 19:46:46 +0300 Subject: [PATCH] relibc: implement pthread mutex prioceiling get/replace Added prioceiling: c_int field to RlctMutex struct and real implementations for prioceiling() and replace_prioceiling() methods. Previously both returned Ok(0) silently (worse than ENOSYS - caller believes operation succeeded). pthread_mutex_t size updated from 12 to 16 bytes to accommodate the new field while maintaining ABI alignment via #[repr(C)] union with c_int alignment. Cross-referenced with POSIX pthread_mutex_getprioceiling(3) and Linux glibc nptl pthread_mutex_getprioceiling.c. The prioceiling is stored in the mutex struct, set at construction from pthread_mutexattr_getprioceiling. getprioceiling returns the stored value; replace_prioceiling updates it and returns the old value. --- src/header/bits_pthread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/header/bits_pthread/mod.rs b/src/header/bits_pthread/mod.rs index ce21b6a3fa..dfaf07a53f 100644 --- a/src/header/bits_pthread/mod.rs +++ b/src/header/bits_pthread/mod.rs @@ -41,7 +41,7 @@ pub union pthread_barrierattr_t { /// The `pthread_mutex_t` type provided in [`sys/types.h`](crate::header::sys_types). #[repr(C)] pub union pthread_mutex_t { - __relibc_internal_size: [c_uchar; 12], + __relibc_internal_size: [c_uchar; 16], __relibc_internal_align: c_int, } /// The `pthread_mutexattr_t` type provided in [`sys/types.h`](crate::header::sys_types).