2 .TH printk 9 "$Date:$" "Linux DDI" "Kernel Functions"
4 printk \- print messages to console log
6 .B #include <linux/kernel.h>
8 .BI "int printk(const char*" fmt ", ...)"
10 Print a formatted message to the kernel console, much like the
12 function of the stdio library. Normally, the message is written to the
13 physical console device of the computer, although this behavior can be
16 function. Messages are also stored in a message log book.
18 The generated string may also start with a message priority code,
19 which sets the priority of the message. The priority code strings are
22 where n is a number from 0 - 7. The following macros are defined in
32 Action must be taken immediately
44 Normal but significant condition
56 printk(KERN_NOTICE "Hello, world.\\n");
59 does the expected thing.
61 Returns the number of characters written to the log.
65 .BR register_console "(9), " syslog "(2)"
69 Stephen Williams (steve@icarus.com)
71 float and double formats are not supported. Floats and doubles do not
72 belong inside the kernel anyhow.
76 implementation protects itself from interruption, so in principle it
77 can be used in interrupts handlers and critical sections. However,
78 there are no guarantees about the console function that is registered.