summaryrefslogtreecommitdiff
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-04 04:10:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-04 04:10:36 -0700
commit70d5032e73d2e8ae7e40229ab6c321daaa618c96 (patch)
tree973f0966a35bf24f1263b3a912d7837ee36ab900 /kernel/printk.c
parentbb241f20abe0143220ac2c835f45df8e4338cb5d (diff)
[PATCH] report size of printk buffer
From: <Andries.Brouwer@cwi.nl> In the old days the printk log buffer had a constant size, and dmesg asked for the 4096, later 8192, later 16384 bytes in there. These days the printk log buffer has variable size, and it is not easy for dmesg to do the right thing, especially when doing a "read and clear". The patch below adds a syslog subfuntion that reports the buffer size.
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 5f2b3c9bbd6e..3b74688184a8 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -240,6 +240,7 @@ __setup("log_buf_len=", log_buf_len_setup);
* 7 -- Enable printk's to console
* 8 -- Set level of messages printed to console
* 9 -- Return number of unread characters in the log buffer
+ * 10 -- Return size of the log buffer
*/
int do_syslog(int type, char __user * buf, int len)
{
@@ -359,6 +360,9 @@ int do_syslog(int type, char __user * buf, int len)
case 9: /* Number of chars in the log buffer */
error = log_end - log_start;
break;
+ case 10: /* Size of the log buffer */
+ error = log_buf_len;
+ break;
default:
error = -EINVAL;
break;