All that printk()
does is to simply add few more bytes into in-memory ring-buffer (and wrap around if end of buffer reached). So, it does not make sense to say whether it is line-buffered or not - this just does not apply.
Also, while in user space stdout
, stderr
make sense, this is not the case in kernel and for printk()
: it does not write to stdout
because there is no such thing in kernel.
Granted, something takes care of actually delivering contents of this ring-buffer to the user - whether it is printing it on serial console or retrieving it with dmesg
, and this typically looks for LF characters to separate lines.