[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191218112840.871338-1-toke@redhat.com>
Date: Wed, 18 Dec 2019 12:28:40 +0100
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>
Cc: Toke Høiland-Jørgensen <toke@...hat.com>,
netdev@...r.kernel.org, bpf@...r.kernel.org,
Naresh Kamboju <naresh.kamboju@...aro.org>
Subject: [PATCH bpf-next] libbpf: Use PRIu64 when printing ulimit value
Naresh pointed out that libbpf builds fail on 32-bit architectures because
rlimit.rlim_cur is defined as 'unsigned long long' on those architectures.
Fix this by using the PRIu64 definition in printf.
Fixes: dc3a2d254782 ("libbpf: Print hint about ulimit when getting permission denied error")
Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
---
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 3fe42d6b0c2f..ba31083998ce 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -117,7 +117,7 @@ static void pr_perm_msg(int err)
return;
if (limit.rlim_cur < 1024)
- snprintf(buf, sizeof(buf), "%lu bytes", limit.rlim_cur);
+ snprintf(buf, sizeof(buf), "%"PRIu64" bytes", limit.rlim_cur);
else if (limit.rlim_cur < 1024*1024)
snprintf(buf, sizeof(buf), "%.1f KiB", (double)limit.rlim_cur / 1024);
else
--
2.24.1
Powered by blists - more mailing lists