RE: KERN_ALERT doesn´t work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I´m implementing a syscall and I want to write some
information on the user terminal. I´ve heard that
using printk(KERN_ALERT"String") could return "String"
to the terminal, but it doesn´t. It just modifies the
file /var/log/messages. My distribution is Fedora Core
2 (kernel 2.6.5). Did somebody get the same problem?
Did I do something wrong? The syscall is working
perfectly, the only problem is that I want to return
information to the user, and using the copy_to_user
function isn´t appropriate, once there are lots of
information (more than 5) I want to retrieve, with
different types (not only string).

Thanks


The console prints the message according to the loglevel. You can change the loglevel of the console by
klogd -c <priority>
eg,
If you want to print the message with priority equal or greater than 2. Then do,
klogd -c 2
IF it is already running kill it and run the above command.


You can print the message to any console by giving it highest priority <0>
printk("<0> Hello world\n");

Learn it in detail here.
http://www.xml.com/ldd/chapter/book/ch04.html

regards manish

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux