Re: procfs question

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

 



On Mon, Jun 19, 2006 at 05:35:53PM +0200, Fernando Apestegu?a wrote:
> On 6/19/06, Greg KH <greg@xxxxxxxxx> wrote:
> >
> >On Mon, Jun 19, 2006 at 04:54:57PM +0200, Fernando Apestegu?a wrote:
> >> On 6/19/06, Greg KH <greg@xxxxxxxxx> wrote:
> >> >Use debugfs instead.  It's much easier to do this there.  If you really
> >> >want to, sysfs can be used also, but it depends on what you want to
> >> >provide in those files.
> >>
> >>
> >> Each file will provide three numbers. So I wouldn't like to duplicate
> >code.
> >> Just write a single read_proc function and then perform the switch to
> >know
> >> which three values should I return.
> >
> >Same thing works for either debugfs or sysfs.
> >
> >> I know about the existence of sysfs but not about debugfs. I would
> >> prefer to use procfs for other reasons (legacy code, in fact).
> >
> >No new procfs files should be added to the kernel, so if you write stuff
> >for this, it will not be accepted by anyone upstream.
> 
> 
> This is not intended to be merged in the kernel, it is only for academic
> purposes. I saw a chapter called "A single callback for many files" in the
> procfs guide at old.kernelnewbies.org. Do you strongly recommend sysfs
> anyway?

I recommend debugfs instead, it is much easier to use for things like
this than procfs, and if you ever do have to merge stuff into the kernel
for some future reason, there will not be any changes needed.

> And another follow up question: is procfs going to be removed or
> something similar? AFAIK there are several commands and applications that
> uses it.

We have moved, and are moving more things, out of procfs that do not
have to do with processes.  Stuff for processes only belong in procfs.

thanks,

greg k-h

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