Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If by sysfs you mean the <code>sysfs()</code> library call, notice this in <code>man 2 sysfs</code>:</p> <blockquote> <p>NOTES</p> <p>This System-V derived system call <strong>is obsolete; don't use it.</strong> On systems with /proc, the same information can be obtained via /proc/filesystems; use that interface instead.</p> </blockquote> <p>I can't recall noticing stuff that had an <code>ioctl()</code> and a sysfs interface, but probably they exist. I'd use the proc or sys handle anyway, since that tends to be less cryptic and more flexible.</p> <p>If by sysfs you mean accessing files in <code>/sys</code>, that's the preferred method.</p> <blockquote> <p><em>I'm looking for generic info, such as "ioctl is faster because you've removed the file layer from the function calls".</em></p> </blockquote> <p>Accessing procfs or sysfs files does not entail an I/O bottleneck because they are not real files -- they are kernel interfaces. So no, accessing this stuff through "the file layer" does not affect performance. This is a not uncommon misconception in linux systems programming, I think. Programmers can be squeamish about system calls that aren't well, system calls, and paranoid that opening a file will be somehow slower. Of course, file I/O in the ABI is just system calls anyway. What makes a normal (disk) file read slow is not the calls to open, read, write, whatever, it's the hardware bottleneck.</p> <p>I always use low level descriptor based functions (<code>open()</code>, <code>read()</code>) instead of high level streams when doing this because at some point some experience led me to believe they were more reliable for this specifically (reading from <code>/proc</code>). I can't say whether that's definitively true. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload