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

Re: proc_file_write



In the docs section of kernelnewbies.com there is a procfs guide by Eirc
Mouw that gives you what you need to write/reead to the procfs.


On Fri, 6 Sep 2002, James S. Johnson wrote:

>
> Is there a description available of how to use proc_file_write?  I have a
> module in kernel 2.4.18 that uses the proc filesystem for output, and am
> modifying it to read settings from proc.  The (broken) algorithm that I am
> using is:
>
> static ssize_t my_proc_file_write(
> 	struct file *file,
> 	const char *buffer,
> 	size_t count,
> 	loff_t *ppos )
> {
> 	int len = <read data with scanf>;
> 	printk( "Flag\n" );
> 	return( len );
> }
>
> which printk's "Flag" infinitely when I "echo 1 > /proc/my_proc_file".
>
> What is thre proper way to use proc_file_write?
>
> James
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>

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