Linux Basics Practice Test: Linux Sysfs — Flashcards | Linux | FatSkills

Linux Basics Practice Test: Linux Sysfs — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

Sysfs is a pseudo file system in the Linux kernel that provides information about kernel subsystems, hardware devices, and device drivers to user space through virtual files. It is a RAM-based filesystem that exports kernel data structures and their attributes, creating a directory for each kobject registered with the system. The directory is created as a subdirectory of the kobject's parent. 

The files and directories in sysfs provide a view of the kobject structures defined internally within the kernel. These files provide information about: Devices, Kernel modules, Filesystems, and Other kernel components. 
Sysfs provides an interface to kernel data structures and allows users to view the device topology of their system as a simple filesystem. Attributes map kernel data to files in sysfs. Kobjects can export files that allow kernel variables to be read from and optionally written to. 
To represent a kobject to sysfs, you use kobject_add(). The store function will be called whenever you are writing something to the sysfs attribute. The show function will be called whenever you are reading the sysfs attribute. 
On success, sysfs() returns the filesystem index for option 1, zero for option 2, and the number of currently configured filesystems for option 3. On error, -1 is returned, and errno is set to indicate the error.

1 of 50 Ready
Sysfs was originally called
device driver filesystem
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password