Re: Very simple doubt regarding modules..

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

 




Raghu R. Arur wrote:

Hi,

I am very new to module programming... I am creating /proc file. I am able to create a proc file using the system call

create_proc_entry(file_name,flags,NULL);

I know that we need to provide the fuctions for writing and reading that file and we need to use struct file_operations;

But what i am not getting is, which system call do i need to call to associate fileoperations with the proc file I created.
int your_proc_read(char *buf, char **start, off_t off, int count, int *eof, void *data);
int your_proc_write(struct file *file, const char *buf, unsigned long count, void *data);

i forgot actually what to fill into the function bodies. sorry.

create your entry;
procfileentry = create_proc_entry(filename,mode,procdirentry);

assign the functions:
procfileentry->read_proc=your_proc_read;
procfileentry->write_proc=your_proc_write;


  expecting an urgent reply....

 thanks,
raghu
have fun.
edwin.

--
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