From 0449324257183bb2286154cd1970a1c218b8c231 Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Sat, 19 Apr 2025 09:54:33 -0400 Subject: [PATCH] posix: semaphores: use a default minimal heap-add for semaphores The implementation of POSIX_SEMAPHORES historically used heap allocation and has not yet been transitioned to a pool allocator. However, since 590258b3814, the default heap-add with CONFIG_POSIX_API has been reduced from 1 kiB which causes tests/posix/semaphores to fail due to NULL being returned from a call to k_calloc(). Create a minimal heap-add for the POSIX_SEMAPHORES Option Group. This can be removed at a future date if semaphores are changed to use a pooled allocator and fixed-size name, rather than heap allocation. Signed-off-by: Chris Friedt --- lib/posix/options/Kconfig.semaphore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/posix/options/Kconfig.semaphore b/lib/posix/options/Kconfig.semaphore index b6b839c9b1f..b2640d97041 100644 --- a/lib/posix/options/Kconfig.semaphore +++ b/lib/posix/options/Kconfig.semaphore @@ -33,4 +33,7 @@ config POSIX_SEM_NAMELEN_MAX Maximum length of name for a named semaphore. The max value of 255 corresponds to {NAME_MAX}. +config HEAP_MEM_POOL_ADD_SIZE_POSIX_SEMAPHORES + def_int 256 + endif # POSIX_SEMAPHORES