Waheni
Waheni

Reputation: 1

proc_dir_entry structure linux 3.13

i am using proc_dir_entry in linux 3.13 but i got this error "dereferencing pointer to incomplete type" in this lines of code :

  struct proc_dir_entry *proc = proc_create("hello_proc", 0, NULL, &hello_proc_fops);
    printk(KERN_DEBUG "name : %s\n",proc->name);

it seem like the compile doesnt recognize the data structure

Upvotes: 0

Views: 2450

Answers (2)

Ian Abbott
Ian Abbott

Reputation: 17503

The internals of struct proc_dir_entry were made opaque in Linux kernel 3.10 by commit 59d8053f1e16904d54ed7469d4b36801ea6b8f2c, so all you get now is a pointer to an incomplete type.

The "dereferencing pointer to incomplete type" error is due to the expression proc->name due to struct proc_dir_entry being incomplete.

Upvotes: 2

canbax
canbax

Reputation: 3856

you can try this answer may be you forgot to put include statements

#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>

Upvotes: 1

Related Questions