linux - Access /proc fs variable from other parts of Kernel code -


i'm trying user-level program communicate kernel via /proc.

i followed instructions on tldp, , able create custom proc file, load dynamically insmod , read (cat) , write (echo) proc file userland.

now question how access /proc variable (it's byte buffer) within part of kernel, system call infrastructure? since custom proc file dynamically loaded , linked, how can reference statically compiled kernel code?

system specs: ubuntu 10.10 running in vmware fusion on macbook pro 13" (2009).

edit: pertinent code (by request) -

procfile.c

//this function called when module loaded int init_module() {     /* create /proc file */      export_symbol(procfs_buffer);     export_symbol(procfs_buffer_size); ... ... } 

get_procvariable.c (in part of kernel)

//the buffer used store character module extern char * procfs_buffer;  //the size of buffer extern unsigned long procfs_buffer_size;  int get_procvariable(void) { .. return procfs_buffer; // ld error: undefined reference } 

do let me know in comments, if need further details. in advance.

you should not reference dynamically loaded code in kernel (ie, modules) statically loaded code (ie, syscalls). if you're putting statically loaded code in kernel, configuration has should exposed other statically loaded code. it's hard give more specific advice without knowing kind of functionality you're implementing, however.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -