문제

I am working on a Linux character device driver for a school assignment and am not sure how to print the *ppos passed into my read function which is of type loff_t.

I know I must use printk rather than the standard library printf from within the kernel but I can't seem to figure out the proper format specifier.

도움이 되었습니까?

해결책

loff_t is just a typedef. To determine which format specifier to use, you should look for its definition:

Then you can refer to the Kernel's documentation to see how to format a "long long" (%lld).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top