What's the true meaning of the printk return value? Should it include the prioty 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 printed string including any prefix". Successful printk calls can have a return value different than the input length (priority prefix, timing), so /bin/echo will still think there is an error. So, to avoid breaking programs that assume write(buff, len) != len is an error, /dev/kmsg should return the buffer length when the call succeeds. The only drawback is that now it's no more possible to use /dev/kmsg to check the printk return value :-( -- Guillaume