Messages in this thread | | | Date | Thu, 24 Feb 2000 03:43:35 +0100 | From | Jamie Lokier <> | Subject | Re: What /proc should contain [was: /proc/driver/microcode] |
| |
H. Peter Anvin wrote: > > Any reason that this file could not be replaced with > > rtc/rtc_time > > rtc/rtc_date > > rtc/rtc_epoch > > etc... > > sysctl entries? Or one fat "rtc" entry" that has the > > whole current file? > > > > /proc/sys/dev/rtc/{time,date,epoch,...} probably would be better, > although sometimes with changing devices one have to consider the > issue of atomicity; sometimes one *have* to be able to perform complex > operations atomically. IMNSHO that's what /dev/rtc is for. > > I personally think the strict formatting of sysctl() is a good thing, > although I do have to agree 10000% with Linus that sysctl() should be > entirely string-based.
You can take it further: Permits reads of /proc/rtc even though it is a directory.
All directories would relay a strictly standard string format of their contents, which is actually very straightforward. In this case, cat /proc/rtc would show:
time: \t<contents of /proc/rtc/time> date: \t<contents of /proc/rtc/date> epoch: \t<contents of /proc/rtc/epoch>
The number of spaces before the \t (tab) is any number from zero up, for pretty alignment. The tab then unambiguously introduces the next field.
You get the idea. Some variation on that that's unambiguously parseable and easy to construct from the individual entries.
Things like /proc/cpuinfo would suddenly look all neat and tidy, be consistent, and you could read specific things of interest by reading, e.g., /proc/cpuinfo/features.
enjoy, -- Jamie
As for the sysctl() system call, I would > either remove it or replace it with a system call taking a file > descriptor to the appropriate /proc/sys node. Although redundant, it > might provide somewhat less overhead than the /proc/sys interface. > > -hpa > -- > <hpa@transmeta.com> at work, <hpa@zytor.com> in private! > "Unix gives you enough rope to shoot yourself in the foot." > > - > 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/
- 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/
| |