Re: LKMPG example program not working !!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[cut]

> The lines 123 - 129 are :
> 
> ----snip-----
> 
> static struct file_operations File_Ops_4_Our_Proc_File
> =
>   {
>     NULL,
>     module_output,
>     module_input,
>     NULL,
>     NULL,
>     NULL,
>     NULL,
>     module_open,
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
>     NULL,
> #endif
>     module_close,
>   };
> ---- snip ------
> 
> this program segment is giving me the incompatible
> pointer type warnings.
> 
> What should I do to correct all these errors.
> 

struct file_operations has changed!
you can see it at

http://lxr.linux.no/source/include/linux/fs.h#L817

It's better this kind of initialization:

struct file_operations File_Ops_4_Our_Proc_File =
{
  read    : module_output,
  write   : module_input,
  open    : module_open,
  release : module_close,
};

Bye,
Roberto


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux