€•¼àŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ+/translations/zh_CN/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/zh_TW/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/it_IT/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ja_JP/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/ko_KR/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/pt_BR/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ+/translations/sp_SP/admin-guide/sysfs-rules”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ+Rules on how to access information in sysfs”h]”hŒ+Rules on how to access information in sysfs”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒE/var/lib/git/docbuild/linux/Documentation/admin-guide/sysfs-rules.rst”h´KubhŒ paragraph”“”)�”}”(hXJThe kernel-exported sysfs exports internal kernel implementation details and depends on internal kernel structures and layout. It is agreed upon by the kernel developers that the Linux kernel does not provide a stable internal API. Therefore, there are aspects of the sysfs interface that may not be stable across kernel releases.”h]”hXJThe kernel-exported sysfs exports internal kernel implementation details and depends on internal kernel structures and layout. It is agreed upon by the kernel developers that the Linux kernel does not provide a stable internal API. Therefore, there are aspects of the sysfs interface that may not be stable across kernel releases.”…”�”}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)�”}”(hXªTo minimize the risk of breaking users of sysfs, which are in most cases low-level userspace applications, with a new kernel release, the users of sysfs must follow some rules to use an as-abstract-as-possible way to access this filesystem. The current udev and HAL programs already implement this and users are encouraged to plug, if possible, into the abstractions these programs provide instead of accessing sysfs directly.”h]”hXªTo minimize the risk of breaking users of sysfs, which are in most cases low-level userspace applications, with a new kernel release, the users of sysfs must follow some rules to use an as-abstract-as-possible way to access this filesystem. The current udev and HAL programs already implement this and users are encouraged to plug, if possible, into the abstractions these programs provide instead of accessing sysfs directly.”…”�”}”(hhÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubhÌ)�”}”(hŒ­But if you really do want or need to access sysfs directly, please follow the following rules and then your programs should work with future versions of the sysfs interface.”h]”hŒ­But if you really do want or need to access sysfs directly, please follow the following rules and then your programs should work with future versions of the sysfs interface.”…”�”}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hXDo not use libsysfs It makes assumptions about sysfs which are not true. Its API does not offer any abstraction, it exposes all the kernel driver-core implementation details in its own API. Therefore it is not better than reading directories and opening the files yourself. Also, it is not actively maintained, in the sense of reflecting the current kernel development. The goal of providing a stable interface to sysfs has failed; it causes more problems than it solves. It violates many of the rules in this document. ”h]”hŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hXDo not use libsysfs It makes assumptions about sysfs which are not true. Its API does not offer any abstraction, it exposes all the kernel driver-core implementation details in its own API. Therefore it is not better than reading directories and opening the files yourself. Also, it is not actively maintained, in the sense of reflecting the current kernel development. The goal of providing a stable interface to sysfs has failed; it causes more problems than it solves. It violates many of the rules in this document. ”h]”(hŒterm”“”)�”}”(hŒDo not use libsysfs”h]”hŒDo not use libsysfs”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´Khj ubhŒ definition”“”)�”}”(hhh]”hÌ)�”}”(hXóIt makes assumptions about sysfs which are not true. Its API does not offer any abstraction, it exposes all the kernel driver-core implementation details in its own API. Therefore it is not better than reading directories and opening the files yourself. Also, it is not actively maintained, in the sense of reflecting the current kernel development. The goal of providing a stable interface to sysfs has failed; it causes more problems than it solves. It violates many of the rules in this document.”h]”hXóIt makes assumptions about sysfs which are not true. Its API does not offer any abstraction, it exposes all the kernel driver-core implementation details in its own API. Therefore it is not better than reading directories and opening the files yourself. Also, it is not actively maintained, in the sense of reflecting the current kernel development. The goal of providing a stable interface to sysfs has failed; it causes more problems than it solves. It violates many of the rules in this document.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhþubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hXqsysfs is always at ``/sys`` Parsing ``/proc/mounts`` is a waste of time. Other mount points are a system configuration bug you should not try to solve. For test cases, possibly support a ``SYSFS_PATH`` environment variable to overwrite the application's behavior, but never try to search for sysfs. Never try to mount it, if you are not an early boot script. ”h]”j)�”}”(hhh]”j)�”}”(hXgsysfs is always at ``/sys`` Parsing ``/proc/mounts`` is a waste of time. Other mount points are a system configuration bug you should not try to solve. For test cases, possibly support a ``SYSFS_PATH`` environment variable to overwrite the application's behavior, but never try to search for sysfs. Never try to mount it, if you are not an early boot script. ”h]”(j)�”}”(hŒsysfs is always at ``/sys``”h]”(hŒsysfs is always at ”…”�”}”(hjSh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``/sys``”h]”hŒ/sys”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjSubeh}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K$hjOubj)�”}”(hhh]”hÌ)�”}”(hXJParsing ``/proc/mounts`` is a waste of time. Other mount points are a system configuration bug you should not try to solve. For test cases, possibly support a ``SYSFS_PATH`` environment variable to overwrite the application's behavior, but never try to search for sysfs. Never try to mount it, if you are not an early boot script.”h]”(hŒParsing ”…”�”}”(hjth²hh³Nh´Nubj\)�”}”(hŒ``/proc/mounts``”h]”hŒ /proc/mounts”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjtubhŒ‡ is a waste of time. Other mount points are a system configuration bug you should not try to solve. For test cases, possibly support a ”…”�”}”(hjth²hh³Nh´Nubj\)�”}”(hŒ``SYSFS_PATH``”h]”hŒ SYSFS_PATH”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjtubhŒŸ environment variable to overwrite the application’s behavior, but never try to search for sysfs. Never try to mount it, if you are not an early boot script.”…”�”}”(hjth²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjqubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjOubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K$hjLubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjHubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hX) devices are only "devices" There is no such thing like class-, bus-, physical devices, interfaces, and such that you can rely on in userspace. Everything is just simply a "device". Class-, bus-, physical, ... types are just kernel implementation details which should not be expected by applications that look for devices in sysfs. The properties of a device are: - devpath (``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``) - identical to the DEVPATH value in the event sent from the kernel at device creation and removal - the unique key to the device at that point in time - the kernel's path to the device directory without the leading ``/sys``, and always starting with a slash - all elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time. - using or exposing symlink values as elements in a devpath string is a bug in the application - kernel name (``sda``, ``tty``, ``0000:00:1f.2``, ...) - a directory name, identical to the last element of the devpath - applications need to handle spaces and characters like ``!`` in the name - subsystem (``block``, ``tty``, ``pci``, ...) - simple string, never a path or a link - retrieved by reading the "subsystem"-link and using only the last element of the target path - driver (``tg3``, ``ata_piix``, ``uhci_hcd``) - a simple string, which may contain spaces, never a path or a link - it is retrieved by reading the "driver"-link and using only the last element of the target path - devices which do not have "driver"-link just do not have a driver; copying the driver value in a child device context is a bug in the application - attributes - the files in the device directory or files below subdirectories of the same device directory - accessing attributes reached by a symlink pointing to another device, like the "device"-link, is a bug in the application Everything else is just a kernel driver-core implementation detail that should not be assumed to be stable across kernel releases. ”h]”j)�”}”(hhh]”j)�”}”(hXÕdevices are only "devices" There is no such thing like class-, bus-, physical devices, interfaces, and such that you can rely on in userspace. Everything is just simply a "device". Class-, bus-, physical, ... types are just kernel implementation details which should not be expected by applications that look for devices in sysfs. The properties of a device are: - devpath (``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``) - identical to the DEVPATH value in the event sent from the kernel at device creation and removal - the unique key to the device at that point in time - the kernel's path to the device directory without the leading ``/sys``, and always starting with a slash - all elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time. - using or exposing symlink values as elements in a devpath string is a bug in the application - kernel name (``sda``, ``tty``, ``0000:00:1f.2``, ...) - a directory name, identical to the last element of the devpath - applications need to handle spaces and characters like ``!`` in the name - subsystem (``block``, ``tty``, ``pci``, ...) - simple string, never a path or a link - retrieved by reading the "subsystem"-link and using only the last element of the target path - driver (``tg3``, ``ata_piix``, ``uhci_hcd``) - a simple string, which may contain spaces, never a path or a link - it is retrieved by reading the "driver"-link and using only the last element of the target path - devices which do not have "driver"-link just do not have a driver; copying the driver value in a child device context is a bug in the application - attributes - the files in the device directory or files below subdirectories of the same device directory - accessing attributes reached by a symlink pointing to another device, like the "device"-link, is a bug in the application Everything else is just a kernel driver-core implementation detail that should not be assumed to be stable across kernel releases. ”h]”(j)�”}”(hŒdevices are only "devices"”h]”hŒdevices are only “devicesâ€�”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K\hjÅubj)�”}”(hhh]”(hÌ)�”}”(hX/There is no such thing like class-, bus-, physical devices, interfaces, and such that you can rely on in userspace. Everything is just simply a "device". Class-, bus-, physical, ... types are just kernel implementation details which should not be expected by applications that look for devices in sysfs.”h]”hX3There is no such thing like class-, bus-, physical devices, interfaces, and such that you can rely on in userspace. Everything is just simply a “deviceâ€�. Class-, bus-, physical, ... types are just kernel implementation details which should not be expected by applications that look for devices in sysfs.”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K'hj×ubhÌ)�”}”(hŒThe properties of a device are:”h]”hŒThe properties of a device are:”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K-hj×ubhø)�”}”(hhh]”(hý)�”}”(hXÅdevpath (``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``) - identical to the DEVPATH value in the event sent from the kernel at device creation and removal - the unique key to the device at that point in time - the kernel's path to the device directory without the leading ``/sys``, and always starting with a slash - all elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time. - using or exposing symlink values as elements in a devpath string is a bug in the application ”h]”(hÌ)�”}”(hŒ?devpath (``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``)”h]”(hŒ devpath (”…”�”}”(hjýh²hh³Nh´Nubj\)�”}”(hŒ5``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``”h]”hŒ1/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjýubhŒ)”…”�”}”(hjýh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K/hjùubhø)�”}”(hhh]”(hý)�”}”(hŒ_identical to the DEVPATH value in the event sent from the kernel at device creation and removal”h]”hÌ)�”}”(hŒ_identical to the DEVPATH value in the event sent from the kernel at device creation and removal”h]”hŒ_identical to the DEVPATH value in the event sent from the kernel at device creation and removal”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K1hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hŒ2the unique key to the device at that point in time”h]”hÌ)�”}”(hj:h]”hŒ2the unique key to the device at that point in time”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K3hj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hŒhthe kernel's path to the device directory without the leading ``/sys``, and always starting with a slash”h]”hÌ)�”}”(hŒhthe kernel's path to the device directory without the leading ``/sys``, and always starting with a slash”h]”(hŒ@the kernel’s path to the device directory without the leading ”…”�”}”(hjSh²hh³Nh´Nubj\)�”}”(hŒ``/sys``”h]”hŒ/sys”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjSubhŒ", and always starting with a slash”…”�”}”(hjSh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K4hjOubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hXall elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time.”h]”hÌ)�”}”(hXall elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time.”h]”hXall elements of a devpath must be real directories. Symlinks pointing to /sys/devices must always be resolved to their real target and the target path must be used to access the device. That way the devpath to the device matches the devpath of the kernel used at event time.”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K6hjyubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hŒ]using or exposing symlink values as elements in a devpath string is a bug in the application ”h]”hÌ)�”}”(hŒ\using or exposing symlink values as elements in a devpath string is a bug in the application”h]”hŒ\using or exposing symlink values as elements in a devpath string is a bug in the application”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K;hj‘ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1h÷h³hÊh´K1hjùubeh}”(h]”h ]”h"]”h$]”h&]”uh1hühjöubhý)�”}”(hŒÅkernel name (``sda``, ``tty``, ``0000:00:1f.2``, ...) - a directory name, identical to the last element of the devpath - applications need to handle spaces and characters like ``!`` in the name ”h]”(hÌ)�”}”(hŒ5kernel name (``sda``, ``tty``, ``0000:00:1f.2``, ...)”h]”(hŒ kernel name (”…”�”}”(hj»h²hh³Nh´Nubj\)�”}”(hŒ``sda``”h]”hŒsda”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj»ubhŒ, ”…”�”}”(hj»h²hh³Nh´Nubj\)�”}”(hŒ``tty``”h]”hŒtty”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj»ubhŒ, ”…”�”}”hj»sbj\)�”}”(hŒ``0000:00:1f.2``”h]”hŒ 0000:00:1f.2”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj»ubhŒ, ...)”…”�”}”(hj»h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K>hj·ubhø)�”}”(hhh]”(hý)�”}”(hŒ>a directory name, identical to the last element of the devpath”h]”hÌ)�”}”(hjh]”hŒ>a directory name, identical to the last element of the devpath”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K@hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjÿubhý)�”}”(hŒIapplications need to handle spaces and characters like ``!`` in the name ”h]”hÌ)�”}”(hŒHapplications need to handle spaces and characters like ``!`` in the name”h]”(hŒ7applications need to handle spaces and characters like ”…”�”}”(hjh²hh³Nh´Nubj\)�”}”(hŒ``!``”h]”hŒ!”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjubhŒ in the name”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KAhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjÿubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´K@hj·ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hühjöubhý)�”}”(hŒ·subsystem (``block``, ``tty``, ``pci``, ...) - simple string, never a path or a link - retrieved by reading the "subsystem"-link and using only the last element of the target path ”h]”(hÌ)�”}”(hŒ,subsystem (``block``, ``tty``, ``pci``, ...)”h]”(hŒ subsystem (”…”�”}”(hjSh²hh³Nh´Nubj\)�”}”(hŒ ``block``”h]”hŒblock”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjSubhŒ, ”…”�”}”(hjSh²hh³Nh´Nubj\)�”}”(hŒ``tty``”h]”hŒtty”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjSubhŒ, ”…”�”}”hjSsbj\)�”}”(hŒ``pci``”h]”hŒpci”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjSubhŒ, ...)”…”�”}”(hjSh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KDhjOubhø)�”}”(hhh]”(hý)�”}”(hŒ%simple string, never a path or a link”h]”hÌ)�”}”(hjœh]”hŒ%simple string, never a path or a link”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KFhjšubah}”(h]”h ]”h"]”h$]”h&]”uh1hühj—ubhý)�”}”(hŒ]retrieved by reading the "subsystem"-link and using only the last element of the target path ”h]”hÌ)�”}”(hŒ\retrieved by reading the "subsystem"-link and using only the last element of the target path”h]”hŒ`retrieved by reading the “subsystemâ€�-link and using only the last element of the target path”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KGhj±ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühj—ubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´KFhjOubeh}”(h]”h ]”h"]”h$]”h&]”uh1hühjöubhý)�”}”(hXpdriver (``tg3``, ``ata_piix``, ``uhci_hcd``) - a simple string, which may contain spaces, never a path or a link - it is retrieved by reading the "driver"-link and using only the last element of the target path - devices which do not have "driver"-link just do not have a driver; copying the driver value in a child device context is a bug in the application ”h]”(hÌ)�”}”(hŒ,driver (``tg3``, ``ata_piix``, ``uhci_hcd``)”h]”(hŒdriver (”…”�”}”(hjÙh²hh³Nh´Nubj\)�”}”(hŒ``tg3``”h]”hŒtg3”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÙubhŒ, ”…”�”}”(hjÙh²hh³Nh´Nubj\)�”}”(hŒ ``ata_piix``”h]”hŒata_piix”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÙubhŒ, ”…”�”}”hjÙsbj\)�”}”(hŒ ``uhci_hcd``”h]”hŒuhci_hcd”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÙubhŒ)”…”�”}”(hjÙh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KJhjÕubhø)�”}”(hhh]”(hý)�”}”(hŒAa simple string, which may contain spaces, never a path or a link”h]”hÌ)�”}”(hŒAa simple string, which may contain spaces, never a path or a link”h]”hŒAa simple string, which may contain spaces, never a path or a link”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KLhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hŒ_it is retrieved by reading the "driver"-link and using only the last element of the target path”h]”hÌ)�”}”(hŒ_it is retrieved by reading the "driver"-link and using only the last element of the target path”h]”hŒcit is retrieved by reading the “driverâ€�-link and using only the last element of the target path”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KNhj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubhý)�”}”(hŒ’devices which do not have "driver"-link just do not have a driver; copying the driver value in a child device context is a bug in the application ”h]”hÌ)�”}”(hŒ‘devices which do not have "driver"-link just do not have a driver; copying the driver value in a child device context is a bug in the application”h]”hŒ•devices which do not have “driverâ€�-link just do not have a driver; copying the driver value in a child device context is a bug in the application”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KPhjPubah}”(h]”h ]”h"]”h$]”h&]”uh1hühjubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´KLhjÕubeh}”(h]”h ]”h"]”h$]”h&]”uh1hühjöubhý)�”}”(hŒëattributes - the files in the device directory or files below subdirectories of the same device directory - accessing attributes reached by a symlink pointing to another device, like the "device"-link, is a bug in the application ”h]”(hÌ)�”}”(hŒ attributes”h]”hŒ attributes”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KThjtubhø)�”}”(hhh]”(hý)�”}”(hŒ\the files in the device directory or files below subdirectories of the same device directory”h]”hÌ)�”}”(hŒ\the files in the device directory or files below subdirectories of the same device directory”h]”hŒ\the files in the device directory or files below subdirectories of the same device directory”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KVhj‰ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühj†ubhý)�”}”(hŒzaccessing attributes reached by a symlink pointing to another device, like the "device"-link, is a bug in the application ”h]”hÌ)�”}”(hŒyaccessing attributes reached by a symlink pointing to another device, like the "device"-link, is a bug in the application”h]”hŒ}accessing attributes reached by a symlink pointing to another device, like the “deviceâ€�-link, is a bug in the application”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KXhj¡ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühj†ubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´KVhjtubeh}”(h]”h ]”h"]”h$]”h&]”uh1hühjöubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´K/hj×ubhÌ)�”}”(hŒ‚Everything else is just a kernel driver-core implementation detail that should not be assumed to be stable across kernel releases.”h]”hŒ‚Everything else is just a kernel driver-core implementation detail that should not be assumed to be stable across kernel releases.”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K[hj×ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjÅubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K\hjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hX»Properties of parent devices never belong into a child device. Always look at the parent devices themselves for determining device context properties. If the device ``eth0`` or ``sda`` does not have a "driver"-link, then this device does not have a driver. Its value is empty. Never copy any property of the parent-device into a child-device. Parent device properties may change dynamically without any notice to the child device. ”h]”j)�”}”(hhh]”j)�”}”(hX¯Properties of parent devices never belong into a child device. Always look at the parent devices themselves for determining device context properties. If the device ``eth0`` or ``sda`` does not have a "driver"-link, then this device does not have a driver. Its value is empty. Never copy any property of the parent-device into a child-device. Parent device properties may change dynamically without any notice to the child device. ”h]”(j)�”}”(hŒ>Properties of parent devices never belong into a child device.”h]”hŒ>Properties of parent devices never belong into a child device.”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´Kdhjøubj)�”}”(hhh]”hÌ)�”}”(hXoAlways look at the parent devices themselves for determining device context properties. If the device ``eth0`` or ``sda`` does not have a "driver"-link, then this device does not have a driver. Its value is empty. Never copy any property of the parent-device into a child-device. Parent device properties may change dynamically without any notice to the child device.”h]”(hŒfAlways look at the parent devices themselves for determining device context properties. If the device ”…”�”}”(hj h²hh³Nh´Nubj\)�”}”(hŒ``eth0``”h]”hŒeth0”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj ubhŒ or ”…”�”}”(hj h²hh³Nh´Nubj\)�”}”(hŒ``sda``”h]”hŒsda”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj ubhŒú does not have a “driverâ€�-link, then this device does not have a driver. Its value is empty. Never copy any property of the parent-device into a child-device. Parent device properties may change dynamically without any notice to the child device.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K_hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjøubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kdhjõubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjñubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hŒîHierarchy in a single device tree There is only one valid place in sysfs where hierarchy can be examined and this is below: ``/sys/devices.`` It is planned that all device directories will end up in the tree below this directory. ”h]”j)�”}”(hhh]”j)�”}”(hŒæHierarchy in a single device tree There is only one valid place in sysfs where hierarchy can be examined and this is below: ``/sys/devices.`` It is planned that all device directories will end up in the tree below this directory. ”h]”(j)�”}”(hŒ!Hierarchy in a single device tree”h]”hŒ!Hierarchy in a single device tree”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´Kjhj^ubj)�”}”(hhh]”hÌ)�”}”(hŒÃThere is only one valid place in sysfs where hierarchy can be examined and this is below: ``/sys/devices.`` It is planned that all device directories will end up in the tree below this directory.”h]”(hŒZThere is only one valid place in sysfs where hierarchy can be examined and this is below: ”…”�”}”(hjsh²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices.``”h]”hŒ /sys/devices.”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjsubhŒX It is planned that all device directories will end up in the tree below this directory.”…”�”}”(hjsh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kghjpubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj^ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kjhj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjWubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hXÖClassification by subsystem There are currently three places for classification of devices: ``/sys/block,`` ``/sys/class`` and ``/sys/bus.`` It is planned that these will not contain any device directories themselves, but only flat lists of symlinks pointing to the unified ``/sys/devices`` tree. All three places have completely different rules on how to access device information. It is planned to merge all three classification directories into one place at ``/sys/subsystem``, following the layout of the bus directories. All buses and classes, including the converted block subsystem, will show up there. The devices belonging to a subsystem will create a symlink in the "devices" directory at ``/sys/subsystem//devices``, If ``/sys/subsystem`` exists, ``/sys/bus``, ``/sys/class`` and ``/sys/block`` can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name. Assuming ``/sys/class/`` and ``/sys/bus/``, or ``/sys/block`` and ``/sys/class/block`` are not interchangeable is a bug in the application. ”h]”j)�”}”(hhh]”j)�”}”(hX®Classification by subsystem There are currently three places for classification of devices: ``/sys/block,`` ``/sys/class`` and ``/sys/bus.`` It is planned that these will not contain any device directories themselves, but only flat lists of symlinks pointing to the unified ``/sys/devices`` tree. All three places have completely different rules on how to access device information. It is planned to merge all three classification directories into one place at ``/sys/subsystem``, following the layout of the bus directories. All buses and classes, including the converted block subsystem, will show up there. The devices belonging to a subsystem will create a symlink in the "devices" directory at ``/sys/subsystem//devices``, If ``/sys/subsystem`` exists, ``/sys/bus``, ``/sys/class`` and ``/sys/block`` can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name. Assuming ``/sys/class/`` and ``/sys/bus/``, or ``/sys/block`` and ``/sys/class/block`` are not interchangeable is a bug in the application. ”h]”(j)�”}”(hŒClassification by subsystem”h]”hŒClassification by subsystem”…”�”}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K‚hj²ubj)�”}”(hhh]”(hÌ)�”}”(hXÁThere are currently three places for classification of devices: ``/sys/block,`` ``/sys/class`` and ``/sys/bus.`` It is planned that these will not contain any device directories themselves, but only flat lists of symlinks pointing to the unified ``/sys/devices`` tree. All three places have completely different rules on how to access device information. It is planned to merge all three classification directories into one place at ``/sys/subsystem``, following the layout of the bus directories. All buses and classes, including the converted block subsystem, will show up there. The devices belonging to a subsystem will create a symlink in the "devices" directory at ``/sys/subsystem//devices``,”h]”(hŒ@There are currently three places for classification of devices: ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ``/sys/block,``”h]”hŒ /sys/block,”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒ ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ``/sys/class``”h]”hŒ /sys/class”…”�”}”(hjáh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒ and ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ ``/sys/bus.``”h]”hŒ /sys/bus.”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒ† It is planned that these will not contain any device directories themselves, but only flat lists of symlinks pointing to the unified ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices``”h]”hŒ /sys/devices”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒ« tree. All three places have completely different rules on how to access device information. It is planned to merge all three classification directories into one place at ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ``/sys/subsystem``”h]”hŒ/sys/subsystem”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒà, following the layout of the bus directories. All buses and classes, including the converted block subsystem, will show up there. The devices belonging to a subsystem will create a symlink in the “devicesâ€� directory at ”…”�”}”(hjÇh²hh³Nh´Nubj\)�”}”(hŒ!``/sys/subsystem//devices``”h]”hŒ/sys/subsystem//devices”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjÇubhŒ,”…”�”}”(hjÇh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KmhjÄubhÌ)�”}”(hX+If ``/sys/subsystem`` exists, ``/sys/bus``, ``/sys/class`` and ``/sys/block`` can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name.”h]”(hŒIf ”…”�”}”(hjAh²hh³Nh´Nubj\)�”}”(hŒ``/sys/subsystem``”h]”hŒ/sys/subsystem”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjAubhŒ exists, ”…”�”}”(hjAh²hh³Nh´Nubj\)�”}”(hŒ ``/sys/bus``”h]”hŒ/sys/bus”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjAubhŒ, ”…”�”}”(hjAh²hh³Nh´Nubj\)�”}”(hŒ``/sys/class``”h]”hŒ /sys/class”…”�”}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjAubhŒ and ”…”�”}”(hjAh²hh³Nh´Nubj\)�”}”(hŒ``/sys/block``”h]”hŒ /sys/block”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjAubhŒÞ can be ignored. If it does not exist, you always have to scan all three places, as the kernel is free to move a subsystem from one place to the other, as long as the devices are still reachable by the same subsystem name.”…”�”}”(hjAh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KzhjÄubhÌ)�”}”(hŒ¡Assuming ``/sys/class/`` and ``/sys/bus/``, or ``/sys/block`` and ``/sys/class/block`` are not interchangeable is a bug in the application.”h]”(hŒ Assuming ”…”�”}”(hj—h²hh³Nh´Nubj\)�”}”(hŒ``/sys/class/``”h]”hŒ/sys/class/”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj—ubhŒ and ”…”�”}”(hj—h²hh³Nh´Nubj\)�”}”(hŒ``/sys/bus/``”h]”hŒ/sys/bus/”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj—ubhŒ, or ”…”�”}”(hj—h²hh³Nh´Nubj\)�”}”(hŒ``/sys/block``”h]”hŒ /sys/block”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj—ubhŒ and ”…”�”}”hj—sbj\)�”}”(hŒ``/sys/class/block``”h]”hŒ/sys/class/block”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj—ubhŒ5 are not interchangeable is a bug in the application.”…”�”}”(hj—h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hjÄubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K‚hj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj«ubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hX;Block The converted block subsystem at ``/sys/class/block`` or ``/sys/subsystem/block`` will contain the links for disks and partitions at the same level, never in a hierarchy. Assuming the block subsystem to contain only disks and not partition devices in the same flat list is a bug in the application. ”h]”j)�”}”(hhh]”j)�”}”(hX1Block The converted block subsystem at ``/sys/class/block`` or ``/sys/subsystem/block`` will contain the links for disks and partitions at the same level, never in a hierarchy. Assuming the block subsystem to contain only disks and not partition devices in the same flat list is a bug in the application. ”h]”(j)�”}”(hŒBlock”h]”hŒBlock”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K‰hj ubj)�”}”(hhh]”hÌ)�”}”(hX*The converted block subsystem at ``/sys/class/block`` or ``/sys/subsystem/block`` will contain the links for disks and partitions at the same level, never in a hierarchy. Assuming the block subsystem to contain only disks and not partition devices in the same flat list is a bug in the application.”h]”(hŒ!The converted block subsystem at ”…”�”}”(hj!h²hh³Nh´Nubj\)�”}”(hŒ``/sys/class/block``”h]”hŒ/sys/class/block”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj!ubhŒ or ”…”�”}”(hj!h²hh³Nh´Nubj\)�”}”(hŒ``/sys/subsystem/block``”h]”hŒ/sys/subsystem/block”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj!ubhŒÙ will contain the links for disks and partitions at the same level, never in a hierarchy. Assuming the block subsystem to contain only disks and not partition devices in the same flat list is a bug in the application.”…”�”}”(hj!h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K…hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K‰hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hXY"device"-link and :-links Never depend on the "device"-link. The "device"-link is a workaround for the old layout, where class devices are not created in ``/sys/devices/`` like the bus devices. If the link-resolving of a device directory does not end in ``/sys/devices/``, you can use the "device"-link to find the parent devices in ``/sys/devices/``, That is the single valid use of the "device"-link; it must never appear in any path as an element. Assuming the existence of the "device"-link for a device in ``/sys/devices/`` is a bug in the application. Accessing ``/sys/class/net/eth0/device`` is a bug in the application. Never depend on the class-specific links back to the ``/sys/class`` directory. These links are also a workaround for the design mistake that class devices are not created in ``/sys/devices.`` If a device directory does not contain directories for child devices, these links may be used to find the child devices in ``/sys/class.`` That is the single valid use of these links; they must never appear in any path as an element. Assuming the existence of these links for devices which are real child device directories in the ``/sys/devices`` tree is a bug in the application. It is planned to remove all these links when all class device directories live in ``/sys/devices.`` ”h]”j)�”}”(hhh]”j)�”}”(hX1"device"-link and :-links Never depend on the "device"-link. The "device"-link is a workaround for the old layout, where class devices are not created in ``/sys/devices/`` like the bus devices. If the link-resolving of a device directory does not end in ``/sys/devices/``, you can use the "device"-link to find the parent devices in ``/sys/devices/``, That is the single valid use of the "device"-link; it must never appear in any path as an element. Assuming the existence of the "device"-link for a device in ``/sys/devices/`` is a bug in the application. Accessing ``/sys/class/net/eth0/device`` is a bug in the application. Never depend on the class-specific links back to the ``/sys/class`` directory. These links are also a workaround for the design mistake that class devices are not created in ``/sys/devices.`` If a device directory does not contain directories for child devices, these links may be used to find the child devices in ``/sys/class.`` That is the single valid use of these links; they must never appear in any path as an element. Assuming the existence of these links for devices which are real child device directories in the ``/sys/devices`` tree is a bug in the application. It is planned to remove all these links when all class device directories live in ``/sys/devices.`` ”h]”(j)�”}”(hŒ1"device"-link and :-links”h]”hŒ5“deviceâ€�-link and :-links”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K¡hjrubj)�”}”(hhh]”(hÌ)�”}”(hXYNever depend on the "device"-link. The "device"-link is a workaround for the old layout, where class devices are not created in ``/sys/devices/`` like the bus devices. If the link-resolving of a device directory does not end in ``/sys/devices/``, you can use the "device"-link to find the parent devices in ``/sys/devices/``, That is the single valid use of the "device"-link; it must never appear in any path as an element. Assuming the existence of the "device"-link for a device in ``/sys/devices/`` is a bug in the application. Accessing ``/sys/class/net/eth0/device`` is a bug in the application.”h]”(hŒˆNever depend on the “deviceâ€�-link. The “deviceâ€�-link is a workaround for the old layout, where class devices are not created in ”…”�”}”(hj‡h²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices/``”h]”hŒ /sys/devices/”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj‡ubhŒS like the bus devices. If the link-resolving of a device directory does not end in ”…”�”}”(hj‡h²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices/``”h]”hŒ /sys/devices/”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj‡ubhŒB, you can use the “deviceâ€�-link to find the parent devices in ”…”�”}”(hj‡h²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices/``”h]”hŒ /sys/devices/”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj‡ubhŒ©, That is the single valid use of the “deviceâ€�-link; it must never appear in any path as an element. Assuming the existence of the “deviceâ€�-link for a device in ”…”�”}”(hj‡h²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices/``”h]”hŒ /sys/devices/”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj‡ubhŒ( is a bug in the application. Accessing ”…”�”}”(hj‡h²hh³Nh´Nubj\)�”}”(hŒ``/sys/class/net/eth0/device``”h]”hŒ/sys/class/net/eth0/device”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj‡ubhŒ is a bug in the application.”…”�”}”(hj‡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhj„ubhÌ)�”}”(hX>Never depend on the class-specific links back to the ``/sys/class`` directory. These links are also a workaround for the design mistake that class devices are not created in ``/sys/devices.`` If a device directory does not contain directories for child devices, these links may be used to find the child devices in ``/sys/class.`` That is the single valid use of these links; they must never appear in any path as an element. Assuming the existence of these links for devices which are real child device directories in the ``/sys/devices`` tree is a bug in the application.”h]”(hŒ5Never depend on the class-specific links back to the ”…”�”}”(hjïh²hh³Nh´Nubj\)�”}”(hŒ``/sys/class``”h]”hŒ /sys/class”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjïubhŒl directory. These links are also a workaround for the design mistake that class devices are not created in ”…”�”}”(hjïh²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices.``”h]”hŒ /sys/devices.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjïubhŒ| If a device directory does not contain directories for child devices, these links may be used to find the child devices in ”…”�”}”(hjïh²hh³Nh´Nubj\)�”}”(hŒ``/sys/class.``”h]”hŒ /sys/class.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjïubhŒÁ That is the single valid use of these links; they must never appear in any path as an element. Assuming the existence of these links for devices which are real child device directories in the ”…”�”}”(hjïh²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices``”h]”hŒ /sys/devices”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjïubhŒ" tree is a bug in the application.”…”�”}”(hjïh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K–hj„ubhÌ)�”}”(hŒcIt is planned to remove all these links when all class device directories live in ``/sys/devices.``”h]”(hŒRIt is planned to remove all these links when all class device directories live in ”…”�”}”(hjEh²hh³Nh´Nubj\)�”}”(hŒ``/sys/devices.``”h]”hŒ /sys/devices.”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hjEubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hj„ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjrubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¡hjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjkubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hX$Position of devices along device chain can change. Never depend on a specific parent device position in the devpath, or the chain of parent devices. The kernel is free to insert devices into the chain. You must always request the parent device you are looking for by its subsystem value. You need to walk up the chain until you find the device that matches the expected subsystem. Depending on a specific position of a parent device or exposing relative paths using ``../`` to access the chain of parents is a bug in the application. ”h]”j)�”}”(hhh]”j)�”}”(hXPosition of devices along device chain can change. Never depend on a specific parent device position in the devpath, or the chain of parent devices. The kernel is free to insert devices into the chain. You must always request the parent device you are looking for by its subsystem value. You need to walk up the chain until you find the device that matches the expected subsystem. Depending on a specific position of a parent device or exposing relative paths using ``../`` to access the chain of parents is a bug in the application. ”h]”(j)�”}”(hŒ2Position of devices along device chain can change.”h]”hŒ2Position of devices along device chain can change.”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´Kªhj€ubj)�”}”(hhh]”hÌ)�”}”(hXâNever depend on a specific parent device position in the devpath, or the chain of parent devices. The kernel is free to insert devices into the chain. You must always request the parent device you are looking for by its subsystem value. You need to walk up the chain until you find the device that matches the expected subsystem. Depending on a specific position of a parent device or exposing relative paths using ``../`` to access the chain of parents is a bug in the application.”h]”(hXŸNever depend on a specific parent device position in the devpath, or the chain of parent devices. The kernel is free to insert devices into the chain. You must always request the parent device you are looking for by its subsystem value. You need to walk up the chain until you find the device that matches the expected subsystem. Depending on a specific position of a parent device or exposing relative paths using ”…”�”}”(hj•h²hh³Nh´Nubj\)�”}”(hŒ``../``”h]”hŒ../”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj•ubhŒ< to access the chain of parents is a bug in the application.”…”�”}”(hj•h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¤hj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj€ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kªhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjyubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubhý)�”}”(hXÄWhen reading and writing sysfs device attribute files, avoid dependency on specific error codes wherever possible. This minimizes coupling to the error handling implementation within the kernel. In general, failures to read or write sysfs device attributes shall propagate errors wherever possible. Common errors include, but are not limited to: ``-EIO``: The read or store operation is not supported, typically returned by the sysfs system itself if the read or store pointer is ``NULL``. ``-ENXIO``: The read or store operation failed Error codes will not be changed without good reason, and should a change to error codes result in user-space breakage, it will be fixed, or the the offending change will be reverted. Userspace applications can, however, expect the format and contents of the attribute files to remain consistent in the absence of a version attribute change in the context of a given attribute.”h]”j)�”}”(hhh]”j)�”}”(hX¦When reading and writing sysfs device attribute files, avoid dependency on specific error codes wherever possible. This minimizes coupling to the error handling implementation within the kernel. In general, failures to read or write sysfs device attributes shall propagate errors wherever possible. Common errors include, but are not limited to: ``-EIO``: The read or store operation is not supported, typically returned by the sysfs system itself if the read or store pointer is ``NULL``. ``-ENXIO``: The read or store operation failed Error codes will not be changed without good reason, and should a change to error codes result in user-space breakage, it will be fixed, or the the offending change will be reverted. Userspace applications can, however, expect the format and contents of the attribute files to remain consistent in the absence of a version attribute change in the context of a given attribute.”h]”(j)�”}”(hŒGWhen reading and writing sysfs device attribute files, avoid dependency”h]”hŒGWhen reading and writing sysfs device attribute files, avoid dependency”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K¿hjÔubj)�”}”(hhh]”(hÌ)�”}”(hŒzon specific error codes wherever possible. This minimizes coupling to the error handling implementation within the kernel.”h]”hŒzon specific error codes wherever possible. This minimizes coupling to the error handling implementation within the kernel.”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K­hjæubhÌ)�”}”(hŒ–In general, failures to read or write sysfs device attributes shall propagate errors wherever possible. Common errors include, but are not limited to:”h]”hŒ–In general, failures to read or write sysfs device attributes shall propagate errors wherever possible. Common errors include, but are not limited to:”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K°hjæubhŒ block_quote”“”)�”}”(hŒÀ``-EIO``: The read or store operation is not supported, typically returned by the sysfs system itself if the read or store pointer is ``NULL``. ``-ENXIO``: The read or store operation failed ”h]”(hÌ)�”}”(hŒ�``-EIO``: The read or store operation is not supported, typically returned by the sysfs system itself if the read or store pointer is ``NULL``.”h]”(j\)�”}”(hŒ``-EIO``”h]”hŒ-EIO”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj ubhŒ~: The read or store operation is not supported, typically returned by the sysfs system itself if the read or store pointer is ”…”�”}”(hj h²hh³Nh´Nubj\)�”}”(hŒ``NULL``”h]”hŒNULL”…”�”}”(hj! h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj ubhŒ.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K´hj ubhÌ)�”}”(hŒ.``-ENXIO``: The read or store operation failed”h]”(j\)�”}”(hŒ ``-ENXIO``”h]”hŒ-ENXIO”…”�”}”(hj= h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j[hj9 ubhŒ$: The read or store operation failed”…”�”}”(hj9 h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¸hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j h³hÊh´K´hjæubhÌ)�”}”(hŒ¶Error codes will not be changed without good reason, and should a change to error codes result in user-space breakage, it will be fixed, or the the offending change will be reverted.”h]”hŒ¶Error codes will not be changed without good reason, and should a change to error codes result in user-space breakage, it will be fixed, or the the offending change will be reverted.”…”�”}”(hj[ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KºhjæubhÌ)�”}”(hŒÁUserspace applications can, however, expect the format and contents of the attribute files to remain consistent in the absence of a version attribute change in the context of a given attribute.”h]”hŒÁUserspace applications can, however, expect the format and contents of the attribute files to remain consistent in the absence of a version attribute change in the context of a given attribute.”…”�”}”(hji h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¾hjæubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjÔubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¿hjÑubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÍubah}”(h]”h ]”h"]”h$]”h&]”uh1hühhùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j¯j°uh1h÷h³hÊh´Khh·h²hubeh}”(h]”Œ+rules-on-how-to-access-information-in-sysfs”ah ]”h"]”Œ+rules on how to access information in sysfs”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÀ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”jš j— sŒ nametypes”}”jš ‰sh}”j— h·sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.