How to capture output of system call that uses printk?
I have a simple system call that uses printk to output some text. I have a small c program that calls the system call. This works, and the desired text is output to the console. How can I capture this text? If I call my program with >somefile.txt, somefile.txt is blank. If I use script, I see the line that calls the c program, but the output from the system call does not appear. If I use script -c <myprogram>, same thing. I'm using a virtual machine via VMware, so I can't even capture the screen because AFAICT, VMware only captures .bmp files. So, how can I capture the output of a system call that uses printk?
Debian 220.127.116.11 kernel.
Edit: FWIW, I was able to:
dmesg | tail > output.txt
to get the text I wanted. So I did what I needed to do - but why can't the output from printk be captured using script or > ?
Last edited by Ook; 04-04-2008 at 09:48 PM.