-
Notifications
You must be signed in to change notification settings - Fork 7.8k
WIP: move time.h to common libc #94876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cfriedt
wants to merge
11
commits into
zephyrproject-rtos:main
Choose a base branch
from
cfriedt:add-zephyr-posix-aep-choice-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
WIP: move time.h to common libc #94876
cfriedt
wants to merge
11
commits into
zephyrproject-rtos:main
from
cfriedt:add-zephyr-posix-aep-choice-v2
+489
−249
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
09fa0ed
to
23a398f
Compare
In order to reduce conflicts with limits defined in external C libraries, move Zephyr's POSIX limits from posix_features.h to limits.h in the common C library sources. In order to give the implementation better control over where POSIX limit definitions originate, use `#include_next <limits.h>` to pull in the corresponding header of the C library, and provide a non-user configurable option `CONFIG_TC_PROVIDES_POSIX_LIMIT_DEFS` that may be set in order to ensure that the C library version of POSIX limits are used. Note: this may mean that runtime invariant values are inconsistent with parts that are actually in use within Zephyr, so applications are encouraged to use `sysconf()` with external C libraries that implement parts of the POSIX standard to query system configuration values at runtime. Signed-off-by: Chris Friedt <[email protected]>
Remove duplicate limits.h headers for multiple libc's and use a common one. Signed-off-by: Chris Friedt <[email protected]>
The eventfd configuration does not need to be so deeply nested within POSIX since it does not depend on POSIX completely. Signed-off-by: Chris Friedt <[email protected]>
Separate the POSIX implementation into two categories: - Extensions to ISO C - System Interfaces The first category include standalone functions that generally do not require OS support or depend on any other features within the POSIX specification. The Option Groups that comprise this category include - POSIX_C_LIB_EXT: e.g. strnlen(), fnmatch() - POSIX_C_LANG_SUPPORT_R: e.g. gmtime_r(), strtok_r() The second category includes the majority of other POSIX Option Groups that do require OS support. The latter group may also be categorized generally as being NATIVE_LIBC_INCOMPATIBLE, although that might eventually become more granular. Signed-off-by: Chris Friedt <[email protected]>
Add a custom Zephyr POSIX subprofile specifically for enabling the default features that Zephyr requires as per the coding guidelines. Signed-off-by: Chris Friedt <[email protected]>
Default POSIX_AEP_CHOICE to POSIX_AEP_CHOICE_ZEPHYR Signed-off-by: Chris Friedt <[email protected]>
Add zephyr-keep-sorted-start and zephyr-keep-sorted-stop comments. Signed-off-by: Chris Friedt <[email protected]>
Introduce CONFIG_TC_PROVIDES_POSIX_TIME_DEFS which indicates whether the libc-provided time.h includes definitions and declarations required for POSIX comnformance. Signed-off-by: Chris Friedt <[email protected]>
Use the realtime clock, since that is always guaranteed to be available with _POSIX_TIMERS. Signed-off-by: Chris Friedt <[email protected]>
Define _POSIX_TIMERS=200809L when so configured. This change is required to ensure that Newlib provides the necessary POSIX timer API definitions in toolchain headers. Signed-off-by: Chris Friedt <[email protected]>
23a398f
to
612a0f9
Compare
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a work in progress to see if the POSIX AEP PR will pass with additional changes to time.h