Sysfs: Difference between revisions

Created page with "==See Also== * The kernel documentation's [http://www.mjmwired.net/kernel/Documentation/sysfs-rules.txt "sysfs rules"] doc ** Suggests one shouldn't use libsysfs!"
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
sysfs was introduced during the Linux 2.5 development cycle as part of a general overhaul of the device model. It provides a view into kernel <tt>kobject</tt>s (and sometimes writable controls). According to kernel documentation, "sysfs is always mounted at <tt>/sys</tt>...other mount points are a system configuration bug" (and <tt>/sys/devices</tt> is the only hierarchy userspace programs ought use). In general, a kernel ''object'' is a sysfs directory, an object ''attribute'' is a sysfs file, and a ''relationship'' between two objects is a symbolic link.
A sysfs file cannot be larger than the page size. It is worth noting that all sysfs leaves report their size (to the <tt>stat(2)</tt> system call) to be 4,096 bytes, no matter their actual length. Their true length can be determined only by performing a <tt>read(2)</tt>.
==See Also==
==See Also==
* The kernel documentation's [http://www.mjmwired.net/kernel/Documentation/sysfs-rules.txt "sysfs rules"] doc
* The kernel documentation's [http://www.mjmwired.net/kernel/Documentation/sysfs-rules.txt "sysfs rules"] doc
** Suggests one shouldn't use libsysfs!
** Suggests one shouldn't use libsysfs!
* The [[procfs]] page