Proc: Manipulating all manners of runtime state information by using file-level system calls and commands. Read more at LinuxJournal.
Proc: Manipulating all manners of runtime state information by using file-level system calls and commands. Read more at LinuxJournal.
Really.
Hmmm… procfs is not deprecated by sysfs? (at least on Linux 2.6)
Yeah, we really should be showing devs how to use /sys. /proc will probably be around for a while, but it sounds like its slowly being replaced by sysfs.
I think proc will stay around for always and will just lose some of the functionality that has always seemed misplaced.
I think the two are supposed to be for different things – sysfs is for exporting information on hardware devices, while procfs provides information about processes, memory use, kernel config, etc.
echo reboot >/dev/reboot
or echo “dma on” >/dev/sdD0/ctl
in Plan9
Can anybody do this in Linux ?
Afaik not; DMA is done via ioctls (which always struck me as “we can’t push the file metaphor any further, let’s put in a back door”). Regarding reboot, I’m sure I’ve seen a similar approach in linux.
Of course, /proc is heavily inspired by plan9…
“Some Plan 9 ideas have been absorbed into modern Unixes, particularly the more innovative open-source versions. FreeBSD has a /proc file system modeled exactly on that of Plan 9 that can be used to query or control running processes. […] Linux’s /proc file system, in addition to presenting process information, holds a variety of synthesized Plan 9-like device files used to query and control kernel internals using predominantly textual interfaces.”
http://www.faqs.org/docs/artu/plan9.html
> echo reboot >/dev/reboot
> or echo “dma on” >/dev/sdD0/ctl
> in Plan9
> Can anybody do this in Linux ?
i did it. nothing happened.except echo reboot > /dev/reboot would make file reboot in /dev/
The sysctl mechanism used in the *BSDs is much better anyway. I’ve always thought it was a bit stupid to have the kernel export information in plain text via the /proc tree to have it parsed by your application back into usable data. And, of course, it’s completely non-portable to other unices, in a typical GNU NIH way.
Linux also has the sysctl system call. /proc/sys is sysctl support, exported as a psuedo filesystem.