Skip to content

Conversation

@cfriedt
Copy link
Member

@cfriedt cfriedt commented Aug 22, 2025

This is just a work in progress to see if the POSIX AEP PR will pass with additional changes to time.h

@cfriedt cfriedt force-pushed the add-zephyr-posix-aep-choice-v2 branch 4 times, most recently from 612a0f9 to 981c75a Compare August 24, 2025 04:23
@cfriedt cfriedt force-pushed the add-zephyr-posix-aep-choice-v2 branch 5 times, most recently from 12436ee to e934289 Compare August 31, 2025 12:46
Chris Friedt added 5 commits August 31, 2025 08:50
pwd.c and grp.c both had incorrect preprocessor guards around the stubs
that they were implementing. Functions were surrounded by

```cpp
..
```

Which is not at all accurate, since that subprofiling option group is
`(CONFIG_)POSIX_SYSTEM_DATABASE_R`.D

Remove the guards, since they are invalid anyway, and at most an
application will link properly.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Rather than duplicating limit logic in several places, de-duplicate it
and centralize preprocessor checks in posix_limits.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Newlib does not seem to define a number of mandatory POSIX limits
(e.g. minimum values).

Include Zephyr's POSIX definitions in an override of Newlib's limits.h
(when the appropriate application conformance macro is provided).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Use the realtime clock, since that is always guaranteed to be available
with _POSIX_TIMERS.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
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 <cfriedt@tenstorrent.com>
@cfriedt cfriedt force-pushed the add-zephyr-posix-aep-choice-v2 branch from e934289 to 796eaf3 Compare August 31, 2025 13:26
@cfriedt cfriedt changed the title WIP: move time.h to common libc posix: rename time.h posix_time.h Aug 31, 2025
Chris Friedt added 6 commits August 31, 2025 09:29
To avoid conflicts between the C library's time.h and posix time.h, use
an "override" header when necessary for C libraries that do not themselves
provide POSIX definitions in time.h .

This will allow non-POSIX C libraries to take advantage of Zephyr's
implementation.
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 <cfriedt@tenstorrent.com>
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 <cfriedt@tenstorrent.com>
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 <cfriedt@tenstorrent.com>
Default POSIX_AEP_CHOICE to POSIX_AEP_CHOICE_ZEPHYR

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Add zephyr-keep-sorted-start and zephyr-keep-sorted-stop
comments.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
@cfriedt cfriedt force-pushed the add-zephyr-posix-aep-choice-v2 branch from 796eaf3 to 8c52fbe Compare August 31, 2025 13:30
@sonarqubecloud
Copy link

@cfriedt cfriedt changed the title posix: rename time.h posix_time.h WIP: add zephyr posix aep choice rev 2 Aug 31, 2025
@cfriedt
Copy link
Member Author

cfriedt commented Aug 31, 2025

moved back to #88547

@cfriedt cfriedt closed this Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant