Skip to content

selftests/bpf: include limits.h needed for PATH_MAX directly #9144

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

Closed

Conversation

eddyz87
Copy link
Collaborator

@eddyz87 eddyz87 commented Jun 18, 2025

Constant PATH_MAX is used in function unpriv_helpers.c:open_config(). This constant is provided by include file <limits.h>. The dependency was added by commit [1], which does not include <limits.h> directly, relying instead on <limits.h> being included from zlib.h -> zconf.h. As it turns out, this is not the case for all systems, e.g. on Fedora 41 zlib 1.3.1 is used, and there <limits.h> is not included from zconf.h. Hence, there is a compilation error on Fedora 41.

[1] commit fc2915b ("selftests/bpf: More precise cpu_mitigations state detection")

Fixes: commit fc2915b ("selftests/bpf: More precise cpu_mitigations state detection")

Constant PATH_MAX is used in function unpriv_helpers.c:open_config().
This constant is provided by include file <limits.h>. The dependency
was added by commit [1], which does not include <limits.h> directly,
relying instead on <limits.h> being included from zlib.h -> zconf.h.
As it turns out, this is not the case for all systems, e.g. on
Fedora 41 zlib 1.3.1 is used, and there <limits.h> is not included
from zconf.h. Hence, there is a compilation error on Fedora 41.

[1] commit fc2915b ("selftests/bpf: More precise cpu_mitigations state detection")

Fixes: commit fc2915b ("selftests/bpf: More precise cpu_mitigations state detection")
Signed-off-by: Eduard Zingerman <[email protected]>
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot force-pushed the bpf-next_base branch 7 times, most recently from a2a54b8 to 2e3dd89 Compare June 25, 2025 01:52
@kernel-patches-daemon-bpf
Copy link

Automatically cleaning up stale PR; feel free to reopen if needed

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