How to call system call from usb driver's code
Hello,
I need to call one system call inside linux-2.6.22.14/drivers/usb/storage/usb.c . I just included <linux/syscalls.h> and called the api like (sys_getpid())... but when I compiled the code, I got error ..undefined refence to sys_getpid.... If anybody has any idea on how to call system call within drivers code.. plz advise.. Mr.J |
I'm not sure but let me guess...
EXPORT_SYMBOL for the API you wanna use, and u can access in driver code getpid() in kernel space ? you need to use process descriptor (struct task_struct) I guess ... -- Ashok |
sys_getpid is not exported since there is no EXPORT_SYMBOL(sys_getpid) defined in the kernel source tree.
|
u can get the pid of a process using the current pointer which is defined in linux/sched.h. current->pid will prints the pid of the user space program that invoked the driver
|
After exporting symbol, it worked.... Thanks for your help.
|
All times are GMT -5. The time now is 03:44 PM. |