From dc56251d064f31cf80dbe184e52086001778e4a8 Mon Sep 17 00:00:00 2001 From: Ben Marsh Date: Thu, 20 Jun 2024 15:26:17 +0100 Subject: [PATCH] posix: sys: sysconf: Unconditionally define POSIX macros The POSIX macros ATEXIT_MAX, PAGE_SIZE, and PAGESIZE (queriable through sysconf()) were conditionally defined only if an existing definition did not already exist. These should be defined unconditionally in their header to ensure they get the correct values. If these macros are defined elsewhere with a different meaning, that's a problem. There was an issue where PAGESIZE was already defined with a different meaning. See #74623 and #74428. This commit defines ATEXIT_MAX, PAGE_SIZE, and PAGESIZE unconditionally. Signed-off-by: Ben Marsh --- include/zephyr/posix/posix_features.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/zephyr/posix/posix_features.h b/include/zephyr/posix/posix_features.h index 4e15fbd6950197f..8ba982a124aa5f6 100644 --- a/include/zephyr/posix/posix_features.h +++ b/include/zephyr/posix/posix_features.h @@ -310,17 +310,10 @@ #define MQ_OPEN_MAX _POSIX_MQ_OPEN_MAX #define MQ_PRIO_MAX _POSIX_MQ_PRIO_MAX -#ifndef ATEXIT_MAX #define ATEXIT_MAX 8 -#endif -#ifndef PAGE_SIZE #define PAGE_SIZE CONFIG_POSIX_PAGE_SIZE -#endif - -#ifndef PAGESIZE #define PAGESIZE PAGE_SIZE -#endif #define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS #define PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX