diff options
author | Matt Mackall <mpm@selenic.com> | 2004-08-22 22:56:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 22:56:21 -0700 |
commit | 683b229286b429244f35726b3c18caec429233bd (patch) | |
tree | fde8ce454e7ddb5ba38b9ad415754ddf9e5d7a3a /kernel | |
parent | 87ff5642a855361eeeafafecf6e67898e706319d (diff) | |
download | history-683b229286b429244f35726b3c18caec429233bd.tar.gz |
[PATCH] vprintk support
Add vprintk call. This lets us directly pass varargs stuff to the console
without using vsnprintf to an intermediate buffer.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/printk.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 8b28dd2b4a98f5..2162a42c09d296 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -508,6 +508,17 @@ static void zap_locks(void) asmlinkage int printk(const char *fmt, ...) { va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; +} + +asmlinkage int vprintk(const char *fmt, va_list args) +{ unsigned long flags; int printed_len; char *p; @@ -521,9 +532,7 @@ asmlinkage int printk(const char *fmt, ...) spin_lock_irqsave(&logbuf_lock, flags); /* Emit the output into the temporary buffer */ - va_start(args, fmt); printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args); - va_end(args); /* * Copy the output into log_buf. If the caller didn't provide @@ -575,6 +584,7 @@ out: return printed_len; } EXPORT_SYMBOL(printk); +EXPORT_SYMBOL(vprintk); /** * acquire_console_sem - lock the console system for exclusive use. |