I'm having trouble passing a variable (specifically an integer) from user mode to kernel mode. This is my code for my system call:
The problem is procnumk stays at 0. When I compile I get a weird message anytime I try to use copy_from_user or get_user that says "modpost: 3 mismatches found"Code:#include <linux/linkage.h> #include <linux/kernel.h> #include <linux/sched.h> asmlinkage int sys_processdisplay(int __user *procnum) { int procnumk = 0; copy_from_user(procnum, procnum, sizeof(int)); printk(KERN_EMERG "procnumk is: %d\n", procnumk); return(1); }
I appreciate any help. Thanks!