Skip to content

libc: remove POSIX_TIMERS dep from COMMON_LIBC_TIME #92590

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/toolchain/armclang/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ choice LIBC_IMPLEMENTATION
config ARMCLANG_STD_LIBC
bool "ARM Compiler C library"
select COMMON_LIBC_STRNLEN
select COMMON_LIBC_TIME if POSIX_TIMERS
select COMMON_LIBC_TIME
help
Use the full Arm Compiler runtime libraries.
A reduced Zephyr minimal libc will be used for library functionality
Expand Down
2 changes: 1 addition & 1 deletion doc/develop/languages/c/common_libc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Time function
*************

This provides an implementation of the standard C function, :c:func:`time`,
relying on the Zephyr function, :c:func:`clock_gettime`. This function can
relying on the Zephyr function, :c:func:`sys_clock_gettime`. This function can
be enabled by selecting :kconfig:option:`COMMON_LIBC_TIME`.

Dynamic Memory Management
Expand Down
5 changes: 1 addition & 4 deletions lib/libc/minimal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ config MINIMAL_LIBC_RAND

config MINIMAL_LIBC_TIME
bool "Time functions"
select COMMON_LIBC_TIME if POSIX_TIMERS
select COMMON_LIBC_TIME
select POSIX_C_LANG_SUPPORT_R
select COMMON_LIBC_GMTIME_R
select COMMON_LIBC_ASCTIME
Expand All @@ -47,9 +47,6 @@ config MINIMAL_LIBC_TIME
help
Enable time() and gmtime_r() for the minimal libc.

time() requires CONFIG_POSIX_TIMERS=y because it relies on the POSIX
clock_gettime() function.

In order to make use of the non-reentrant gmtime(), it is necessary
to set CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS=y.

Expand Down