how to kernel printf a int64_t?

Tim Kientzle tim at kientzle.com
Fri Oct 31 05:10:16 UTC 2014


On Oct 30, 2014, at 2:01 PM, Rick Macklem <rmacklem at uoguelph.ca> wrote:

> Hi,
> 
> I feel kinda dumb asking this, but...
>       int64_t i;
> 
>       printf("%qd\n", (u_quad_t)i);
> 
> works but looks dorky, to put it technically;-).
> Is there a better way to printf() a int64_t in the kernel?

I often use the following to print large integers:

    printf(“%jd\n”, (intmax_t)i);

Tim



More information about the freebsd-hackers mailing list