Commit 396fc20
authored
posix: Ensure CLOCK_REALTIME and CLOCK_MONOTONIC use Zephyr clock IDs
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>1 parent 322da1d commit 396fc20
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
| 80 | + | |
82 | 81 | | |
83 | | - | |
84 | 82 | | |
85 | | - | |
| 83 | + | |
86 | 84 | | |
87 | | - | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
| |||
0 commit comments