[PATCH] printk return value: fix it
authorGuillaume Chazarain <guichaz@yahoo.fr>
Sun, 8 Jan 2006 09:02:41 +0000 (01:02 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 04:13:52 +0000 (20:13 -0800)
commit025510cd20f4c35c3958bea133d96c9bd7c6ef9e
treea1d7946374dc6db660ffbf76a1ae862c629566d1
parent2520f14ca85e38f575eed6acc6e586df246abea6
[PATCH] printk return value: fix it

What's the true meaning of the printk return value?  Should it include the
priority prefix length of 3?  and what about the timing information?  In
both cases it was broken:

strace -e write echo 1 > /dev/kmsg
=> write(1, "1\n", 2)                      = 5
strace -e write echo "<1>1" > /dev/kmsg
=> write(1, "<1>1\n", 5)                   = 8

The returned length was "length of input string + 3", I made it "length
of string output to the log buffer".

Note that I couldn't find any printk caller in the kernel interested by its
return value besides kmsg_write.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
Acked-By: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/printk.c