I'm currently writing a Linux kernel module, and I need to handle va_list
in one of my functions, which looks like:
void blah(int flag, va_list va) {
...
if (flag & BLAH_1) {
...
printk(... va here ...); // where I need the printk() with va_list support
...
}
...
}
So I need a printk()
-like function which supports varargs. Like vprintf()
to printf()
.
I Google'd for vprintk
, but had no luck finding it.
You can always use vsnprintf() to format a va_list
into a buffer, and pass that buffer to printk()
.
However, a vprintk()
function seems to exist in the kernel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With