diff options
Diffstat (limited to 'linux/printk.c')
-rw-r--r-- | linux/printk.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/linux/printk.c b/linux/printk.c new file mode 100644 index 00000000..d8f40d59 --- /dev/null +++ b/linux/printk.c @@ -0,0 +1,20 @@ +#include <stdarg.h> +#include <stdio.h> + +static inline const char *real_fmt(const char *fmt) +{ + return fmt[0] == '\001' ? fmt + 2 : fmt; +} + +void vprintk(const char *fmt, va_list args) +{ + vprintf(real_fmt(fmt), args); +} + +void printk(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + vprintk(fmt, args); + va_end(args); +} |