Skip to content

Commit

Permalink
posix: sys: sysconf: Unconditionally define POSIX macros
Browse files Browse the repository at this point in the history
The POSIX macros 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 zephyrproject-rtos#74623 and zephyrproject-rtos#74428.

The POSIX macro ATEXIT_MAX is also conditionally defined and should be
unconditionally defined, but there is currently a definition in picolibc
(picolibc/newlib/libc/include/stdlib.h) so this change will be done
separately.

This commit defines PAGE_SIZE, and PAGESIZE unconditionally.

Signed-off-by: Ben Marsh <[email protected]>
  • Loading branch information
besmarsh committed Jul 8, 2024
1 parent 1ed04e7 commit 2f6b989
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions include/zephyr/posix/posix_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,8 @@
#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
Expand Down

0 comments on commit 2f6b989

Please sign in to comment.