bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly
@ 2025-06-18  9:31 Eduard Zingerman
  2025-06-18 12:56 ` Viktor Malik
  2025-06-18 14:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Eduard Zingerman @ 2025-06-18  9:31 UTC (permalink / raw)
  To: bpf, ast
  Cc: andrii, daniel, martin.lau, kernel-team, yonghong.song,
	Eduard Zingerman

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 fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")

Fixes: fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
---
 tools/testing/selftests/bpf/unpriv_helpers.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/bpf/unpriv_helpers.c b/tools/testing/selftests/bpf/unpriv_helpers.c
index 3aa9ee80a55e..f997d7ec8fd0 100644
--- a/tools/testing/selftests/bpf/unpriv_helpers.c
+++ b/tools/testing/selftests/bpf/unpriv_helpers.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <errno.h>
+#include <limits.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly
  2025-06-18  9:31 [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly Eduard Zingerman
@ 2025-06-18 12:56 ` Viktor Malik
  2025-06-18 14:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Viktor Malik @ 2025-06-18 12:56 UTC (permalink / raw)
  To: Eduard Zingerman, bpf, ast
  Cc: andrii, daniel, martin.lau, kernel-team, yonghong.song

On 6/18/25 11:31, Eduard Zingerman wrote:
> 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 fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")
> 
> Fixes: fc2915bb8bfc ("selftests/bpf: More precise cpu_mitigations state detection")
> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>

Just ran across this on a ppc Fedora 42. Thanks for the fix, it works!

Acked-by: Viktor Malik <vmalik@redhat.com>

> ---
>  tools/testing/selftests/bpf/unpriv_helpers.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/bpf/unpriv_helpers.c b/tools/testing/selftests/bpf/unpriv_helpers.c
> index 3aa9ee80a55e..f997d7ec8fd0 100644
> --- a/tools/testing/selftests/bpf/unpriv_helpers.c
> +++ b/tools/testing/selftests/bpf/unpriv_helpers.c
> @@ -1,6 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  
>  #include <errno.h>
> +#include <limits.h>
>  #include <stdbool.h>
>  #include <stdlib.h>
>  #include <stdio.h>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly
  2025-06-18  9:31 [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly Eduard Zingerman
  2025-06-18 12:56 ` Viktor Malik
@ 2025-06-18 14:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-18 14:00 UTC (permalink / raw)
  To: Eduard Zingerman
  Cc: bpf, ast, andrii, daniel, martin.lau, kernel-team, yonghong.song

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Wed, 18 Jun 2025 02:31:34 -0700 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v1] selftests/bpf: include limits.h needed for PATH_MAX directly
    https://git.kernel.org/bpf/bpf-next/c/cd7312a78f36

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-18 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18  9:31 [PATCH bpf-next v1] selftests/bpf: include limits.h needed for PATH_MAX directly Eduard Zingerman
2025-06-18 12:56 ` Viktor Malik
2025-06-18 14:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).