is the kernel
version of printf
, whose output
goes to the console
. There is also console_print()
, which is more like puts
and thus more efficient
in some cases (hint hint, resc's example should have used console_print!!). The "urgency
" is actually another string
, and the compiler will concatinate
it and your format string
Similarly, there is also a kernel-space sprintf implementation.
Oh, and printk() can be really easy to overflow
: on my kernel
, at least, the buffer used
is only 1024 bytes, and 3 of those are used for the urgency. And it won't do a bounds check. Short messages only.