lkml.org 
[lkml]   [2000]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 64bit type printf formats...
On Thu, 3 Feb 2000, Richard B. Johnson wrote:

> On Thu, 3 Feb 2000, Raj, Ashok wrote:
>
> > Hello.
> >
> > Is there a 64bit type printf format. If so is that available for printk
> > also?
> >
> > thanks
> > ashokr
>
> ../linux/lib/vsprintf.c seems to handle 'long long'. Try it and
> see. It's 'printk("%L\n", long_long);', a quick glance of the source
> seems to show.

This bit of code shows that the kernel's long-long works.

Just compile this and insert it as a module. You can remove it
also.


#define MODULE
#define __KERNEL__
#include <linux/kernel.h>
#include <linux/module.h>

unsigned long long foo = 0x1234123412341234;

int init_module()
{
printk("%Lu\n", foo);
printk("%16Lx\n", foo);
return 0;
}
void cleanup_module()
{
printk("Removed\n");
return;
}

FYI, writing a tiny module like this is how I test things in the
kernel environment. Great stuff, those modules.


Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).


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

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.028 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site