Reputation: 453
everyone, I'm trying to learn how to work with Kernel of the Linux Red Hat, I tried to change some function from kernel:
/*
* sys_execve() executes a new program.
*/
asmlinkage int sys_execve(struct pt_regs regs)
{
int error;
char * filename;
filename = getname((char *) regs.ebx);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
printk("Hello World!"); // I added this function
error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s);
if (error == 0)
current->ptrace &= ~PT_DTRACE;
putname(filename);
out:
return error;
}
this system call executes programs, my question why while I'm in terminal and writing some function for example 'date' I don't receive my hello world, thanks in advance for any help
Upvotes: 2
Views: 666
Reputation: 61457
printk()
should be logged to /proc/kmsg
, which in turn is read and logged by syslog(8)
.
Upvotes: 2