Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Echo value to Linux console

How can I, in C, output a value from a syscall to the Linux console so that it will be visible after a dmesg? What method do I use for printing?

like image 941
kavun Avatar asked Apr 16 '26 00:04

kavun


1 Answers

You're looking for the printk() function; some documentation on the types that it supports is found in Documentation/printk-formats.txt. It is defined in kernel/printk.c.

like image 126
sarnold Avatar answered Apr 17 '26 15:04

sarnold