Skip to content

Conversation

M-Moawad
Copy link
Collaborator

Some toolchains may define CLOCK_REALTIME and
CLOCK_MONOTONIC in their libc headers
with values that differ from Zephyr's internal
SYS_CLOCK_REALTIME and SYS_CLOCK_MONOTONIC.

To ensure consistent behavior across all boards and toolchains, undefine these macros and redefine them to match Zephyr's expected clock IDs.

This prevents mismatched clock IDs being passed to the kernel, avoiding invalid clockid errors when using functions like clock_gettime().

Fixing issue: zephyrproject-rtos#93073

Some toolchains may define CLOCK_REALTIME and 
CLOCK_MONOTONIC in their libc headers
with values that differ from Zephyr's internal 
SYS_CLOCK_REALTIME and SYS_CLOCK_MONOTONIC.

To ensure consistent behavior across all boards and 
toolchains, undefine these macros and redefine them 
to match Zephyr's expected clock IDs.

This prevents mismatched clock IDs being passed to 
the kernel, avoiding invalid clockid errors when using 
functions like clock_gettime().

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant