RE: Proc file entry

From: Oertel, Tim (Tim.Oertel@usa.xerox.com)
Date: Thu Jun 08 2000 - 16:55:28 EST


In case you haven't gotten any responses yet, I'll take a stab
at it, given my limited understanding...

It looks like you are mixing a device entry with a proc entry.

To get the infinite loop to stop, return(0) at some point (assuming
my guess that you are actually creating a dev entry (in proc) is
correct).

I believe the "proper" way to create a proc entry is with a
create_proc_entry(my_name, my_mode, &proc_root); where proc_root
is a kernel global. Take what that returns and fill in the fields you
want, particularly the read_proc.

The read_proc() function should stuff data into the buffer provided,
returning the number of bytes filled in, returning 0 when nothing is
left and setting *eof = 1;

Hope that helps... and is correct. :)

-- Tim

From: pramodh mallipatna [mailto:pramodh@ittc.ukans.edu]
Sent: Wednesday, June 07, 2000 9:16 PM
>
> Hello,
>
> I have a device driver and I need to have a /proc entry for my driver.
> I added an entry looking at fs/proc/root.c
>
> What happens now is that when I cat /proc/mydriverinfo, it
> displays the
> stuff, but in an infinite loop. It comes out if I hit a ctrl-c.
>
> I have explained what I have done below.
>
> Could anyone tell me why is it going in an infinite loop.
>
> Thanks,
> Pramodh
>
> fs/proc/root.c
> --------------
[snip]

--
"Beware of he who would deny you access to information, for in his heart
he dreams himself your master." - SMAC

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:16 EST