Got a question about printk/printf - preferably in kernel level, but printf(3)() should likely help as well.
I got some C code that does some arithmetic with the apparently static "tick" variable in the kernel. I haven't found the definition (yet), but I suppose it's u64. However, somehow, when I printf the vlaue with "%llu" I get a negative number.
What am I doing wrong here?
Example:
I am getting as result: tmp_jiffies = -2146056371
Not sure, how that's even possible??? Even an overflow should be positive, I'd assume?
I got some C code that does some arithmetic with the apparently static "tick" variable in the kernel. I haven't found the definition (yet), but I suppose it's u64. However, somehow, when I printf the vlaue with "%llu" I get a negative number.
What am I doing wrong here?
Example:
Code:
unsigned long long tmp_jiffies;
tmp_jiffies = jiffies; //jiffies is a define jiffies ticks
printf("tmp_jiffies = %llu", tmp_jiffies);
I am getting as result: tmp_jiffies = -2146056371
Not sure, how that's even possible??? Even an overflow should be positive, I'd assume?