-
Notifications
You must be signed in to change notification settings - Fork 7k
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
posix: sysconf: add a "small" implementation option #69882
Conversation
0a8222d
to
a366d42
Compare
Was hoping to tag @awojasinski for review here as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
include/zephyr/posix/unistd.h
Outdated
@@ -99,6 +99,7 @@ extern "C" { | |||
#define _POSIX2_C_BIND _POSIX_VERSION | |||
#define _POSIX2_C_DEV (-1L) | |||
#define _POSIX2_CHAR_TERM (-1L) | |||
#define _POSIX2_DELAYTIMER_MAX (-1L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define _POSIX2_DELAYTIMER_MAX (-1L) | |
#define _POSIX2_DELAYTIMER_MAX (-1L) |
Previously, sysconf() was only available as a macro (i.e. the "extra-small" option). This has the advantage of being compile-time constant, and optimized for both space and speed. One disadvantage is that querying an `_SC_` value that was invalid or unsupported would result in a compile error. Provide a "small" implementation of sysconf() (via Kconfig choice) as a normal addressable function. Signed-off-by: Christopher Friedt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously,
sysconf()
was only available as a macro (i.e. the "extra-small" option).That has the advantage of being compile-time constant, optimized for both space and speed. One disadvantage is that a querying an
_SC_
value that was invalid or unsupported would result in a compile error.Provide a "small" implementation of
sysconf()
(via Kconfig choice) as a normal addressable function.See also #56670