Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: /proc guidelines and sysctl | Date | 6 Jan 2000 13:44:02 -0800 |
| |
In article <8725685E.007519CF.00@d53mta03h.boulder.ibm.com>, <breed@almaden.ibm.com> wrote: > >I wrote an wireless ethernet driver awhile ago >(http://www.cse.ucsc.edu/~breed/airo.html) and found the /proc interface to >be an extremely useful interface to the many knobs in the card. I am a bit >uncomfortable defining my own namespace in the /proc file system (did it >anyway:) and I've been wondering for a while if there are guidelines >somewhere on where things should go. I would really like to tap into an >existing directory for ethX for example...
The thing to do is to create a
/proc/drivers/<drivername>/
directory. The /proc/drivers/ directory is already there, so you'd basically do something like
create_proc_info_entry("driver/mydriver/status", 0, NULL, mydriver_status_read);
to create a "status" file (etc etc).
>And finally, what's up with sysctl? Are driver writers recommended to use >that over extending /proc or is it deprecated? Again guide lines would be >nice.
sysctl is deprecated. It's useful in one way only: it has some nice functions that can be used to add a block of /proc names. However, it has other downsides (allocating silly numbers etc - there should be no need for that, considering that the /proc namespace is alreayd a perfectly good namespace).
Linus
- 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/
| |