Hello,
So let's I have a struct that I want to read from user-level space that is defined in the kernel-space, but the user-level space has multiple processes.
Example:
In a kernel module, I have a global struct. struct { int a; int b; } test;
In a user-level module, I have "externed" that global struct
extern struct { int a; int b; } test;
Compiler doesn't complain, and linkage editor doesn't complain. However, if the user has multiple processes, then is that struct cloned for each process? If I use shared memory along with extern, then I could access the kernel's struct, and if I have n processes, then there's only 1 struct since its shared. I can access a kernel-level variable with 1 user-level process, but if I have more processes, then I get clones for each struct that is "externed"
My question is, Can multiple user-level processes read a kernel-level variable?