How can I get the PID of the user process which triggered my Kernel module's file_operation.read
routine (i.e., which process is reading /dev/mydev
) ?
When your read function is executing, it's doing so in the context of the process that issued the system call. You should thus pe able to use current
, i.e. current->pid
.