Carsten Otte wrote:
John Summerfied wrote:

If kernel hackers were "abusing" /proc, then perhaps they agree with me
that /dev isn't the right place either.

Now that sysfs exists, would that be "the right place?"

No, I don't think so. /sys is used to represent the device tree. And once
you say it isn't a device [/dev]...

/sys looks to me (and I've just cast my eye over its contents, not read
docs about it) to provide a means to control the environment. For example

--w-------  1 root root   4096 Oct 12 08:02
class/pcmcia_socket/pcmcia_socket0/card_eject

Since this is write-only, it looks like it might be used to spit out my
(wireless) card, and the companion insert "file" to insert a card.

I really do think that a character device is the right thing here: You
write a command into it and read the response from it. And it's neither a
file on your disk nor a pipe to another app nor a network socket.

The nice thing about /proc and (apparently) /sys is that one can, at a
pinch, control many functions by simply reading with cat and writing
with echo. There are several things particular to my Toshiba laptop that
I can control in this way, and if I can do that then I can write a
script to automate something (eg choosing runlevel based on which of
three buttons is used to boot the computer). I recall previous
discussion on controlling DASD devices using similar entries (in /proc),
and one commonly sees advice to turn (network) forwarding on or off
using "echo >/proc/sys/net/ipv4/ip_forward 1"


In comparison, to control stuff via entries in /dev is quite difficult
and beyond most sysadmins, let alone users.


--

Cheers
John

-- spambait
[EMAIL PROTECTED]  [EMAIL PROTECTED]
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

do not reply off-list

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to