-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix many things #83368
Draft
cfriedt
wants to merge
8
commits into
zephyrproject-rtos:main
Choose a base branch
from
cfriedt:create-posix-system-database-option-group
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
fix many things #83368
cfriedt
wants to merge
8
commits into
zephyrproject-rtos:main
from
cfriedt:create-posix-system-database-option-group
Conversation
This file contains 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
Before an integer file descriptor may be used, it must be finalized. This is where most fields are initialized. Previously, if a file object is was re-used, it could inherit the offset field of the previously closed file object, making reading from the beginning of the file impossible until the offset was manually zero'ed. The offset should *always* be zero when a file is newly opened. Signed-off-by: Chris Friedt <[email protected]>
Do not set TC_PROVIDES_POSIX_C_LANG_SUPPORT_R as the default in lib/posix/options/Kconfig.c_lang_r . TC_PROVIDES options are only intended to be set by C libraries that implement parts of the POSIX standard. Signed-off-by: Chris Friedt <[email protected]>
Previously, there was an implicit assumption that Zephyr's internal struct fd_entry * was synonymous with FILE * from the C library. This is generally not the case and aliasing these two distinct types was preventing a fair bit of functionality from Just Working - namely stdio function calls like fgets() and fopen(). The problem count be seen directly when trying to use a function like zvfs_fdopen(). Instead of aliasing the two types, require that all Zephyr C libraries provide a z_libc_file_alloc() function that allocates and populates the required fields of a FILE object. Zephyr currently only provides the integer file descriptor to the C library for initializing FILE objects. Signed-off-by: Chris Friedt <[email protected]>
Provide an implementation for the POSIX_SYSTEM_DATABASE_R Option Group. This group is required for all conforming implementations and is therefore required for PSE51, PSE52, PSE53, PSE54, and all other possible subprofiles. Signed-off-by: Chris Friedt <[email protected]>
Add a teststuite to exercise the POSIX_SYSTEM_DATABASE_R Option Group. Signed-off-by: Chris Friedt <[email protected]>
Provide an implementation for the POSIX_SYSTEM_DATABASE Option Group. Signed-off-by: Chris Friedt <[email protected]>
Provide an implementation of the POSIX_FILE_LOCKING Option Group. Signed-off-by: Chris Friedt <[email protected]>
The functions associated with the _POSIX_THREAD_SAFE_FUNCTIONS Option are members of other POSIX Option Groups. Specifically, POSIX_C_LANG_SUPPORT_R, POSIX_FILE_LOCKING, POSIX_FILE_SYSTEM_R, and POSIX_SYSTEM_DATABASE_R. Moreover, _POSIX_THREAD_SAFE_FUNCTIONS is required to be available with any conforming implementation. Therefore, it does not make sense to have a Kconfig option to turn it off or on; it should be enabled or disabled based on whether the required POSIX Option Groups are active. Signed-off-by: Chris Friedt <[email protected]>
cfriedt
force-pushed
the
create-posix-system-database-option-group
branch
from
December 24, 2024 19:03
5ad1363
to
164eac8
Compare
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 a partial solution to the libc FILE / zvfs fd_entry alias problem (see commit titled "os: fdtable: provide z_libc_file_alloc() abstraction").
I might try to pull this branch in here as well.
main...cfriedt:zephyr:posix-hidden-kconfig-for-thread-safe-functions
We should theoretically be able to implement
POSIX_SYSTEM_DATABASE
with eitherPOSIX_SYSTEM_DATABASE_R
functions or with file locking and readline-type calls.