lkml.org 
[lkml]   [2004]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk and long long
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@hotmail.com>:

> 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@vger.kernel.org
> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2011 Jasper Spaans