Re: printk and long long

From: wdebruij
Date: Wed Feb 11 2004 - 08:37:10 EST


how about simply using a shift to output two regular longs, i.e.

printk("%ld%ld",loff_t >> (sizeof(long) * 8), loff_t << sizeof(long) * 8 >>
sizeof(long) * 8);

perhaps you could even place this ghastly code in a macro if you have to access
it often (so that you don't have to look at it :)?

I know it's not pretty, but at least the %ld is considered standard printf
functionality. I don't think %lld (even if it is implemented in some printf
derivates) can be considered portable.

Willem
Citeren sting sting <zstingx@xxxxxxxxxxx>:

> Hello,
> I am trying to perfrom printk with a variable of type long long.
> (loff_t is that type and it is long long , as can be seen in
> posix+types.h).
> what is the format string for such a type ?
> I had tried %lld" but it gace wrpng results.
> regards,
> sting
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/