schemacs
schemacs

Reputation: 2891

Get proc_dir_entry of /proc directly

I could use following code to get the /proc entry, but how to get the /proc entry directly? Any function in the kernel to do this directly(without creating one dummy sub-entry)?

  new_proc = proc_create("dummy", 0644, 0, &fileops_struct);
  root = new_proc->parent;

Upvotes: 0

Views: 646

Answers (1)

Olaf Dietsche
Olaf Dietsche

Reputation: 74098

I haven't found a function, but you might access proc_root directly.

It is located in fs/proc/root.c and should be accessible from outside.

Upvotes: 1

Related Questions