All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Network Development <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>
Subject: Re: [PATCH bpf-next] libbpf: Use PRIu64 when printing ulimit value
Date: Wed, 18 Dec 2019 07:37:31 -0800	[thread overview]
Message-ID: <CAADnVQKP3-ebzctUi+7t9YcHkJWt-Y+BToksnhTBgbe2VseUCQ@mail.gmail.com> (raw)
In-Reply-To: <20191218112840.871338-1-toke@redhat.com>

On Wed, Dec 18, 2019 at 3:28 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> 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@linaro.org>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.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);

please use %zu and (size_t) cast like the rest of libbpf.
Thanks!

      reply	other threads:[~2019-12-18 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 11:28 [PATCH bpf-next] libbpf: Use PRIu64 when printing ulimit value Toke Høiland-Jørgensen
2019-12-18 15:37 ` Alexei Starovoitov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAADnVQKP3-ebzctUi+7t9YcHkJWt-Y+BToksnhTBgbe2VseUCQ@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=naresh.kamboju@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.