Skip to content
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: use Z_SC_VAL_IFDEF for sysconf constants #70138

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Mar 13, 2024

Previously, CONFIG_MAX_TIMER_COUNT and CONFIG_MSG_COUNT_MAX were used without checking if CONFIG_TIMER and CONFIG_POSIX_MQUEUE were enabled.

Use Z_SC_VAL_IFDEF() to conditionally define those constants based on their gating Kconfig values, otherwise, they are defined to -1.

Partially
Fixes #70136

@cfriedt cfriedt requested review from yashi, jukkar and ycsin March 13, 2024 03:12
@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Mar 13, 2024
@cfriedt cfriedt force-pushed the issues/70136/cannot-build-hello-world-with-sysconf-enabled branch from 5946f34 to 625c0d9 Compare March 13, 2024 03:54
jukkar
jukkar previously approved these changes Mar 13, 2024
Copy link
Collaborator

@yashi yashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works for me. thanks.

@@ -216,7 +216,7 @@ extern "C" {
#define SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX
#define STREAM_MAX _POSIX_STREAM_MAX
#define SYMLOOP_MAX _POSIX_SYMLOOP_MAX
#define TIMER_MAX CONFIG_MAX_TIMER_COUNT
#define TIMER_MAX Z_SC_VAL_IFDEF(CONFIG_TIMER, CONFIG_MAX_TIMER_COUNT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not aligned.

@cfriedt cfriedt force-pushed the issues/70136/cannot-build-hello-world-with-sysconf-enabled branch from 625c0d9 to 94b4f25 Compare March 13, 2024 06:55
jukkar
jukkar previously approved these changes Mar 13, 2024
Previously, CONFIG_MAX_TIMER_COUNT and CONFIG_MSG_COUNT_MAX were
used without checking if CONFIG_TIMER and CONFIG_POSIX_MQUEUE
were enabled.

Use Z_SC_VAL_IFDEF() to conditionally define those constants
based on their gating Kconfig values, otherwise, they are defined
to -1.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
@cfriedt cfriedt force-pushed the issues/70136/cannot-build-hello-world-with-sysconf-enabled branch from 94b4f25 to dcde1e5 Compare March 13, 2024 09:50
@ycsin ycsin requested a review from jukkar March 13, 2024 10:11
@cfriedt cfriedt merged commit 9a0b8e7 into zephyrproject-rtos:main Mar 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to build hello world with CONFIG_POSIX_SYSCONF_IMPL_FULL=y
5 participants