Re: interview question how does application connects to device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> How would using sysfs be useful if we were to talk about interacting with, let's say, a file system? ioctl's are quite versatile and rather easy to use when one wants to interact with a given FS.
>
> For instance, one can manage a Btrfs file system by using an user-level tool, which heavily uses ioctl's. Requiring it to interact with sysfs instead seems like complicating something simple with no apparent purpose.

Franlky, I've never used the sysfs interface and mostly know it from
'theoretical' view-point. It was created mostly for providing a
uniform way for user-space applications (udev/HAL, driver tools, etc)
to interact with a device driver. It exposes the underlying device
topology as a directory tree.

I'm not sure how sysfs applies to 'filesystem' as it depicts a
particular 'device hierarchy tree' within a kernel. As Greg mentioned
here, lot filesystem drivers still prefer to use the ioctl interface.
However, one use for it which I can see, is for controlling the
underlying block device (hard-disk, USB mass storage etc).

HTH,
-mandeep

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux